From db827eec154212ca828d267d25a64984ad8358ac Mon Sep 17 00:00:00 2001 From: rupa Date: Mon, 20 May 2013 12:51:43 -0400 Subject: [PATCH] Throw away tmp files if mv fails Attempt to get rid of stale temp files that occasionally drop. While there is anecdotal evidence that this doesn't solve the problem, it doesn't hurt, and it's the only place I can see to fix it. --- z.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/z.sh b/z.sh index 20539c5..7fc79ec 100644 --- a/z.sh +++ b/z.sh @@ -80,7 +80,7 @@ _z() { if [ $? -ne 0 -a -f "$datafile" ]; then env rm -f "$tempfile" else - env mv -f "$tempfile" "$datafile" + env mv -f "$tempfile" "$datafile" || env rm -f "$tmpfile" fi # tab completion