aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-04-27 22:19:48 (GMT)
committermarkt <markt>2007-04-27 22:19:48 (GMT)
commitf342b1758abe89b8e02905d9f31e9b766973d122 (patch)
treedd56f536b3c59ac64dedf245f1cd25129c512a0c
parent6848e180a69cf55840f337f2ca3e70db44f25fd5 (diff)
downloadfluxbox-f342b1758abe89b8e02905d9f31e9b766973d122.zip
fluxbox-f342b1758abe89b8e02905d9f31e9b766973d122.tar.bz2
bug in command line parsing
-rw-r--r--ChangeLog4
-rw-r--r--src/main.cc11
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ed3b5d..cad8eaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1: 2Changes for 1.1:
3*07/04/24:
4 * Fixed a bug in parsing cli (Mathias, thanks to Steven Kah Hien Wong <steven
5 at zensaki dot com> for pointing out the issue)
6 src/main.cc
3*07/04/23: 7*07/04/23:
4 * Set IconicState on all unmapped clients and unmap clients with frames, as 8 * Set IconicState on all unmapped clients and unmap clients with frames, as
5 per ICCCM 4.1.4 (Mark) 9 per ICCCM 4.1.4 (Mark)
diff --git a/src/main.cc b/src/main.cc
index 7b98597..643c6a4 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -181,7 +181,7 @@ static void showInfo(ostream &ostr) {
181 181
182int main(int argc, char **argv) { 182int main(int argc, char **argv) {
183 183
184 string session_display = ""; 184 string session_display("");
185 string rc_file; 185 string rc_file;
186 string log_filename; 186 string log_filename;
187 187
@@ -200,7 +200,7 @@ int main(int argc, char **argv) {
200 exit(EXIT_FAILURE); 200 exit(EXIT_FAILURE);
201 } 201 }
202 202
203 rc_file = arg; 203 rc_file = argv[i];
204 } else if (arg == "-display") { 204 } else if (arg == "-display") {
205 // check for -display option... to run on a display other than the one 205 // check for -display option... to run on a display other than the one
206 // set by the environment variable DISPLAY 206 // set by the environment variable DISPLAY
@@ -212,7 +212,7 @@ int main(int argc, char **argv) {
212 exit(EXIT_FAILURE); 212 exit(EXIT_FAILURE);
213 } 213 }
214 214
215 session_display = arg; 215 session_display = argv[i];
216 string display_env = "DISPLAY=" + session_display; 216 string display_env = "DISPLAY=" + session_display;
217 if (putenv(const_cast<char *>(display_env.c_str()))) { 217 if (putenv(const_cast<char *>(display_env.c_str()))) {
218 cerr<<_FB_CONSOLETEXT(main, WarnDisplayEnv, 218 cerr<<_FB_CONSOLETEXT(main, WarnDisplayEnv,
@@ -225,11 +225,11 @@ int main(int argc, char **argv) {
225 cout << "Fluxbox " << __fluxbox_version << " : (c) 2001-2007 Henrik Kinnunen " << endl << endl; 225 cout << "Fluxbox " << __fluxbox_version << " : (c) 2001-2007 Henrik Kinnunen " << endl << endl;
226 exit(EXIT_SUCCESS); 226 exit(EXIT_SUCCESS);
227 } else if (arg == "-log") { 227 } else if (arg == "-log") {
228 if (i + 1 >= argc) { 228 if (++i >= argc) {
229 cerr<<_FB_CONSOLETEXT(main, LOGRequiresArg, "error: '-log' needs an argument", "")<<endl; 229 cerr<<_FB_CONSOLETEXT(main, LOGRequiresArg, "error: '-log' needs an argument", "")<<endl;
230 exit(EXIT_FAILURE); 230 exit(EXIT_FAILURE);
231 } 231 }
232 log_filename = argv[++i]; 232 log_filename = argv[i];
233 } else if (arg == "-help" || arg == "-h") { 233 } else if (arg == "-help" || arg == "-h") {
234 // print program usage and command line options 234 // print program usage and command line options
235 printf(_FB_CONSOLETEXT(main, Usage, 235 printf(_FB_CONSOLETEXT(main, Usage,
@@ -338,3 +338,4 @@ int main(int argc, char **argv) {
338 338
339 return exitcode; 339 return exitcode;
340} 340}
341