[hackers] [st] little clean up. || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Mon, 26 Apr 2010 21:59:00 +0000 (UTC)

changeset: 79:5b6474453e77
tag: tip
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Tue Apr 27 00:04:29 2010 +0200
files: st.c
description:
little clean up.

diff -r 38096b8efa0a -r 5b6474453e77 st.c
--- a/st.c Mon Apr 26 19:20:53 2010 +0200
+++ b/st.c Tue Apr 27 00:04:29 2010 +0200
@@ -208,12 +208,10 @@
 
 void
 execsh(void) {
- char *shell = getenv("SHELL");
- if(!shell)
- shell = "/bin/sh";
- char *args[3] = {shell, "-i", NULL};
+ char *args[3] = {getenv("SHELL"), "-i", NULL};
+ DEFAULT(args[0], "/bin/sh"); /* default shell if getenv() failed */
         putenv("TERM=" TNAME);
- execvp(shell, args);
+ execvp(args[0], args);
 }
 
 void
Received on Mon Apr 26 2010 - 21:59:00 UTC

This archive was generated by hypermail 2.2.0 : Mon Apr 26 2010 - 22:00:07 UTC