Quoth Rodolfo kix Garcia,
IMO, the code should be:457 XFreeStringList(argv); --removed line--- 458 } 459 460 /* Work done, all ok */ 461 return True; 462 }
I'm attaching a patch (patch 2) to do as you suggest. I have no opinion as to which style is better.
438 for (i = 0; i< argc; i++) 439 a[i] = argv[i];
The style you quote is used throughout so my original patch is unarguably incorrect. Patch 1 fixes.
From 0b5c013ba8d6eea0ac54dfe5b32680a52223f3d7 Mon Sep 17 00:00:00 2001 From: Iain Patterson <[email protected]> Date: Tue, 10 Apr 2012 10:43:58 +0100 Subject: [PATCH 2/3] Compiler diet. Don't feed the compiler. RelaunchWindow() is declared to return Bool so Bool it shall proudly return. --- src/main.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 0cda851..36f5a1e 100644 --- a/src/main.c +++ b/src/main.c @@ -456,10 +456,8 @@ Bool RelaunchWindow(WWindow *wwin) wAddDeathHandler(pid, (WDeathHandler *) shellCommandHandler, data); XFreeStringList(argv); - return True; } - /* compiler food */ return True; } -- 1.7.7.6
From ece6fa9962b1ec726ea024e16098d0a10f24dd98 Mon Sep 17 00:00:00 2001 From: Iain Patterson <[email protected]> Date: Tue, 10 Apr 2012 10:41:17 +0100 Subject: [PATCH 1/3] Style consistency. Approved style is not to write a single-operation for loop in a single line. --- src/main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/main.c b/src/main.c index 6696c2c..0cda851 100644 --- a/src/main.c +++ b/src/main.c @@ -435,7 +435,8 @@ Bool RelaunchWindow(WWindow *wwin) } int i; - for (i = 0; i < argc; i++) a[i] = argv[i]; + for (i = 0; i < argc; i++) + a[i] = argv[i]; a[i] = NULL; execvp(a[0], a); -- 1.7.7.6
