]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/proctitle.c
ABI: Symbol renames for libucw and libcharset
[libucw.git] / ucw / proctitle.c
index 1862f0b5c3b9f36942c5646e27619c493726979a..82a0b8eda3433b6d5c271535eadacb3400f6b961 100644 (file)
@@ -7,8 +7,8 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/process.h"
+#include <ucw/lib.h>
+#include <ucw/process.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -53,8 +53,12 @@ setproctitle_init(int argc, char **argv)
     if (spt_end+1 == oldenv[i])
       spt_end = oldenv[i] + strlen(oldenv[i]);
 
+  /* Copy all arguments */
+  for (i=0; i<argc; i++)
+    argv[i] = xstrdup(argv[i]);
+
   /* Recalculate program_invocation_name, otherwise syslog() will be confused. */
-  char *name = xstrdup(argv[0]);
+  char *name = argv[0];
   program_invocation_name = name;
   char *p = strrchr(name, '/');
   if (p)