diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-08-12 07:13:17 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-08-12 07:13:30 +0530 |
commit | 7eafce9b45cbf8c6609434c420b9f7fe8a962454 (patch) | |
tree | 8c92e6571fc72bdb05b010f70c0c8de38359569d | |
parent | 5dba524565084455a7d3a44fc3ab76635bc713dd (diff) | |
download | nnn-7eafce9b45cbf8c6609434c420b9f7fe8a962454.tar.gz |
Fix #320
-rw-r--r-- | src/nnn.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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)]; |