summaryrefslogtreecommitdiff
path: root/libc-parts/process-spawn.c
diff options
context:
space:
mode:
authorneal <neal>2008-07-08 14:07:56 +0000
committerneal <neal>2008-07-08 14:07:56 +0000
commit6df49ca1a377b5d0e70682ba7118076af2cc801a (patch)
tree77edd358a230872900340357680c15f50d3f3082 /libc-parts/process-spawn.c
parent062419af3894fc9be7accfc0ec9bd223edf61bd3 (diff)
hieronymus/
2008-07-08 Neal H. Walfield <neal@gnu.org> * Makefile.am (modules.h): Generate an array of arguments from each module's command line. (ruth_commandline): Don't quote arguments. * hieronymus.c (struct module): Remove field commandline, replace with args. (main): Create the argument vector based on the MODULES[I].ARGS. libc-parts/ 2008-07-08 Neal H. Walfield <neal@gnu.org> * process-spawn.c (process_spawn): Don't add an extra trailing NUL to the argment vector or the environment vector. * ia32-cmain.c (finish): Assume the command line is in argz format and parse it appropriately.
Diffstat (limited to 'libc-parts/process-spawn.c')
-rw-r--r--libc-parts/process-spawn.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libc-parts/process-spawn.c b/libc-parts/process-spawn.c
index 552c5a8..299040c 100644
--- a/libc-parts/process-spawn.c
+++ b/libc-parts/process-spawn.c
@@ -207,7 +207,7 @@ process_spawn (addr_t activity,
/* Add the argument vector. If it would overflow the space, we
truncate it (which is useless but we'll error out soon). */
- int n = 1;
+ int n = 0;
int i;
for (i = 0; argv[i]; i ++)
n += strlen (argv[i]) + 1;
@@ -228,11 +228,10 @@ process_spawn (addr_t activity,
memcpy (p, argv[i], len);
p += len;
}
- *p = '\0';
offset += n;
- n = 1;
+ n = 0;
if (env)
for (i = 0; env[i]; i ++)
n += strlen (env[i]) + 1;
@@ -252,7 +251,6 @@ process_spawn (addr_t activity,
memcpy (p, env[i], len);
p += len;
}
- *p = '\0';
}
/* Point the descriptors after the argument string at the next