aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-03 00:28:53 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-03 00:28:53 +0530
commit36cd5b72a5f2ca6d396c44145f9186993149f4d6 (patch)
tree59b0ba3dbe2bbed862184ae2397824ea505d6563
parent78115189034ac52eefa4e51931108b9904ea23fb (diff)
downloadnnn-36cd5b72a5f2ca6d396c44145f9186993149f4d6.tar.gz
Fix clang warning
-rw-r--r--src/nnn.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/nnn.c b/src/nnn.c
index e91d40d..9a92e96 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1205,6 +1205,18 @@ static bool xrm(char *path)
return TRUE;
}
+static void archive_selection(const char *archive, const char *curpath)
+{
+ snprintf(g_buf, CMD_LEN_MAX,
+#ifdef __linux__
+ "xargs -0 -a %s %s %s",
+#else
+ "cat %s | xargs -0 -o %s %s",
+#endif
+ g_cppath, utils[APACK], archive);
+ spawn("sh", "-c", g_buf, curpath, F_NORMAL | F_SIGINT);
+}
+
/*
* Returns:
* FALSE - a message is shown
@@ -3658,17 +3670,8 @@ nochange:
goto nochange;
}
- if (r == 's') {
- snprintf(g_buf, CMD_LEN_MAX,
-#ifdef __linux__
- "xargs -0 -a %s %s %s",
-#else
- "cat %s | xargs -0 -o %s %s",
-#endif
- g_cppath, utils[APACK], tmp);
- spawn("sh", "-c", g_buf, path, F_NORMAL | F_SIGINT);
- } else
- spawn(utils[APACK], tmp, dents[cur].name, path, F_NORMAL);
+ r == 's' ? archive_selection(tmp, path)
+ : spawn(utils[APACK], tmp, dents[cur].name, path, F_NORMAL);
break;
case SEL_OPENWITH:
dir = NULL;