[hackers] [st] -e flag handles arguments. || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Sun, 28 Nov 2010 11:17:34 +0000 (UTC)

changeset: 174:bdb4064af341
tag: tip
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Sun Nov 28 13:17:20 2010 +0100
files: st.c
description:
-e flag handles arguments.

diff -r a180e93eb0d3 -r bdb4064af341 st.c
--- a/st.c Sun Nov 28 01:40:39 2010 +0100
+++ b/st.c Sun Nov 28 13:17:20 2010 +0100
@@ -545,11 +545,15 @@
 
 void
 execsh(void) {
- char *args[] = {getenv("SHELL"), "-i", NULL};
+ char **args;
+ char *envshell = getenv("SHELL");
+ DEFAULT(envshell, "sh");
+
         if(opt_cmd)
- args[0] = opt_cmd, args[1] = NULL;
+ args = (char*[]){"sh", "-c", opt_cmd, NULL};
         else
- DEFAULT(args[0], SHELL);
+ args = (char*[]){envshell, "-i", NULL};
+
         putenv("TERM="TNAME);
         execvp(args[0], args);
 }
Received on Sun Nov 28 2010 - 12:17:34 CET

This archive was generated by hypermail 2.2.0 : Sun Nov 28 2010 - 12:24:05 CET