fixed a bug in parsing cli, thanks to steven kah hien wong <steven at zensaki dot com>

This commit is contained in:
mathias 2007-04-24 19:38:40 +00:00
parent 35605d9c77
commit 5eb658a51f
2 changed files with 10 additions and 5 deletions

View file

@ -1,5 +1,9 @@
(Format: Year/Month/Day)
Changes for 1.0.0:
*07/04/24:
* Fixed a bug in parsing cli (Mathias, thanks to Steven Kah Hien Wong <steven at
zensaki dot com> for pointing out the issue)
src/main.cc
*07/04/23:
* Use asciidoc-generated manpages as the default from now on (Mathias)
* Disabled resizing shaded windows (Mark)

View file

@ -181,7 +181,7 @@ static void showInfo(ostream &ostr) {
int main(int argc, char **argv) {
string session_display = "";
string session_display("");
string rc_file;
string log_filename;
@ -200,7 +200,7 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
rc_file = arg;
rc_file = argv[i];
} else if (arg == "-display") {
// check for -display option... to run on a display other than the one
// set by the environment variable DISPLAY
@ -212,7 +212,7 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
session_display = arg;
session_display = argv[i];
string display_env = "DISPLAY=" + session_display;
if (putenv(const_cast<char *>(display_env.c_str()))) {
cerr<<_FB_CONSOLETEXT(main, WarnDisplayEnv,
@ -225,11 +225,11 @@ int main(int argc, char **argv) {
cout << "Fluxbox " << __fluxbox_version << " : (c) 2001-2007 Henrik Kinnunen " << endl << endl;
exit(EXIT_SUCCESS);
} else if (arg == "-log") {
if (i + 1 >= argc) {
if (++i >= argc) {
cerr<<_FB_CONSOLETEXT(main, LOGRequiresArg, "error: '-log' needs an argument", "")<<endl;
exit(EXIT_FAILURE);
}
log_filename = argv[++i];
log_filename = argv[i];
} else if (arg == "-help" || arg == "-h") {
// print program usage and command line options
printf(_FB_CONSOLETEXT(main, Usage,
@ -338,3 +338,4 @@ int main(int argc, char **argv) {
return exitcode;
}