From 0db23b586fb4e9a88586511da862e191965d1522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 11 Jul 2021 22:43:01 +0200 Subject: name.c: Support file names beginning with dash --- name.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/name.c b/name.c index e74cd31..bf12277 100644 --- a/name.c +++ b/name.c @@ -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){ -- cgit v1.2.3