Browse Source

* Further fix restart issue

svn: 3568
Bryan Drewery 18 years ago
parent
commit
d0e68d5214
1 changed files with 10 additions and 7 deletions
  1. 10 7
      src/misc.c

+ 10 - 7
src/misc.c

@@ -731,15 +731,18 @@ restart(int idx)
 
   /* replace image now */
   char *argv[4] = { NULL, NULL, NULL, NULL };
-  char shit[7] = "";
-
-  if (!backgrd || term_z || sdebug)
-    simple_sprintf(shit, "-%s%s%s", !backgrd ? "n" : "", term_z ? "t" : "", sdebug ? "D" : "");
 
   argv[0] = strdup(shell_escape(binname));
-  argv[1] = strdup(shit);
-  argv[2] = strdup(shell_escape(conf.bot->nick));
-  argv[3] = NULL;
+
+  if (!backgrd || term_z || sdebug) {
+    char shit[7] = "";
+
+    simple_sprintf(shit, "-%s%s%s", !backgrd ? "n" : "", term_z ? "t" : "", sdebug ? "D" : "");
+    argv[1] = strdup(shit);
+    argv[2] = strdup(shell_escape(conf.bot->nick));
+  } else {
+    argv[1] = strdup(shell_escape(conf.bot->nick));
+  }
 
   unlink(conf.bot->pid_file);
   FILE *fp = NULL;