diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-11 22:43:01 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-11 22:43:01 +0200 |
commit | 0db23b586fb4e9a88586511da862e191965d1522 (patch) | |
tree | 27f0721bae7fc6aaed2b79842add12595b4c2f4e | |
parent | de1d7cd15a6792deca7b1d5f2ee1bf84d9751980 (diff) | |
download | re-name-0db23b586fb4e9a88586511da862e191965d1522.tar.gz |
name.c: Support file names beginning with dash
-rw-r--r-- | name.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -86,11 +86,11 @@ usage: fprintf(stderr, "usage: %s [-x]\n", name); * If the -x flag is given, they are executed too. */ for(i = 0; i < j; i++){ - escape(froms[i], &tmp); printf("mv '%s'", tmp); + escape(froms[i], &tmp); printf("mv -- '%s'", tmp); escape(tos[i], &tmp); printf(" '%s'\n", tmp); if(xflag){ if(!fork()){ - execl("/bin/mv", "mv", froms[i], tos[i], NULL); + execl("/bin/mv", "mv", "--", froms[i], tos[i], NULL); err(1, "execl"); } if(wait(&s), s){ |