aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-01-24 17:13:16 (GMT)
committermarkt <markt>2007-01-24 17:13:16 (GMT)
commit69bac5d56ff60dfce108e3a25270aab8eaf2b345 (patch)
treeabe9e8e3a25698e55478bc9844c48b6880e50d57
parenta5ee8e9d91b30081b80d0dc622a774482a3612c9 (diff)
downloadfluxbox_paul-69bac5d56ff60dfce108e3a25270aab8eaf2b345.zip
fluxbox_paul-69bac5d56ff60dfce108e3a25270aab8eaf2b345.tar.bz2
detect shell from environment variable
-rw-r--r--ChangeLog3
-rw-r--r--src/FbCommands.cc8
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 63a3452..d889d42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*07/01/24:
4 * Detect user's shell from environment rather than assuming /bin/sh (Mark)
5 FbCommands.cc
3*07/01/21: 6*07/01/21:
4 * Allow transparency in window buttons, so they show the titlebar underneath 7 * Allow transparency in window buttons, so they show the titlebar underneath
5 instead of black (Mark) 8 instead of black (Mark)
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 83025ec..5fbceab 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -143,12 +143,18 @@ int ExecuteCmd::run() {
143 143
144 sprintf(intbuff, "%d", screen_num); 144 sprintf(intbuff, "%d", screen_num);
145 145
146 // get shell path from the environment
147 // this process exits immediately, so we don't have to worry about memleaks
148 char *shell = getenv("SHELL");
149 if (!shell)
150 shell = "/bin/sh";
151
146 // remove last number of display and add screen num 152 // remove last number of display and add screen num
147 displaystring.erase(displaystring.size()-1); 153 displaystring.erase(displaystring.size()-1);
148 displaystring += intbuff; 154 displaystring += intbuff;
149 setsid(); 155 setsid();
150 putenv(const_cast<char *>(displaystring.c_str())); 156 putenv(const_cast<char *>(displaystring.c_str()));
151 execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), static_cast<void*>(NULL)); 157 execl(shell, shell, "-c", m_cmd.c_str(), static_cast<void*>(NULL));
152 exit(0); 158 exit(0);
153 159
154 return pid; // compiler happy -> we are happy ;) 160 return pid; // compiler happy -> we are happy ;)