mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-27 17:02:33 +01:00
fixed cmdline option duplication bug
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -610,6 +610,7 @@ real_main(int argc, char **argv)
|
||||
int i, restart=0;
|
||||
char *str, *alt;
|
||||
int d, s;
|
||||
int flag;
|
||||
#ifdef DEBUG
|
||||
Bool doSync = False;
|
||||
#endif
|
||||
@@ -622,13 +623,16 @@ real_main(int argc, char **argv)
|
||||
str = wstrconcat("WMAKER_BIN_NAME=", argv[0]);
|
||||
putenv(str);
|
||||
|
||||
ArgCount = argc+1;
|
||||
Arguments = wmalloc(sizeof(char*)*(ArgCount+2));
|
||||
flag= 0;
|
||||
ArgCount = argc;
|
||||
Arguments = wmalloc(sizeof(char*)*(ArgCount+1));
|
||||
for (i= 0; i < argc; i++)
|
||||
Arguments[i]= argv[i];
|
||||
{
|
||||
Arguments[i]= argv[i];
|
||||
}
|
||||
/* add the extra option to signal that we're just restarting wmaker */
|
||||
Arguments[argc]= "--for-real=";
|
||||
Arguments[argc+1]= NULL;
|
||||
Arguments[argc-1]= "--for-real=";
|
||||
Arguments[argc]= NULL;
|
||||
|
||||
WMInitializeApplication("WindowMaker", &argc, argv);
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ int MonitorLoop(int argc, char **argv)
|
||||
char **child_argv= wmalloc(sizeof(char*)*(argc+2));
|
||||
int i, status;
|
||||
time_t last_start;
|
||||
|
||||
|
||||
for (i= 0; i < argc; i++)
|
||||
child_argv[i]= argv[i];
|
||||
child_argv[i++]= "--for-real";
|
||||
@@ -123,9 +123,9 @@ int MonitorLoop(int argc, char **argv)
|
||||
wsyserror(_("Error during monitoring of Window Maker process."));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
child_argv[argc]= "--for-real-";
|
||||
|
||||
|
||||
/* Check if the wmaker process exited due to a crash */
|
||||
if (WIFSIGNALED(status) &&
|
||||
(WTERMSIG(status) == SIGSEGV ||
|
||||
|
||||
Reference in New Issue
Block a user