From: Arun Prakash Jana <engineerarun@gmail.com>
Date: Mon, 22 Jul 2019 17:25:04 +0000 (+0530)
Subject: Fix #307
X-Git-Tag: v2.6~26
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=27214bfca6c1ecf460dfd2ecb266a2451b3103cc;p=nnn.git

Fix #307
---

diff --git a/src/nnn.c b/src/nnn.c
index 6a2e6432..beaa87ff 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1193,7 +1193,7 @@ 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 | xargs -d'\n' -n2 mv 2>/dev/null";
+	const char renamecmd[] = "paste -d'\n' %s %s | tr '\n' '\\0' | xargs -0 -n2 mv";
 	char foriginal[TMP_LEN_MAX] = {0};
 	char buf[sizeof(renamecmd) + (PATH_MAX << 1)];