From 7eafce9b45cbf8c6609434c420b9f7fe8a962454 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 12 Aug 2019 07:13:17 +0530 Subject: Fix #320 --- src/nnn.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 6938b8b..9290d94 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1213,7 +1213,13 @@ static bool batch_rename(const char *path) int fd1, fd2, i; uint count = 0, lines = 0; bool dir = FALSE, ret = FALSE; - const char renamecmd[] = "paste -d'\n' %s %s | tr '\n' '\\0' | xargs -0 -n2 mv 2>/dev/null"; + const char renamecmd[] = +#ifdef __OpenBSD__ + /* OpenBSD does not have the -n option for mv */ + "paste -d'\n' %s %s | tr '\n' '\\0' | xargs -0 -n2 mv 2>/dev/null"; +#else + "paste -d'\n' %s %s | tr '\n' '\\0' | xargs -0 -n2 mv -n 2>/dev/null"; +#endif char foriginal[TMP_LEN_MAX] = {0}; char buf[sizeof(renamecmd) + (PATH_MAX << 1)]; -- cgit v1.2.3-70-g09d2