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