aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-07-19 16:00:29 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-07-19 16:00:29 +0000
commit2ef1d3aa9ab65844a79385a17cb68e13ef686103 (patch)
treed8bfe72752593712e1c86f26d151990f1de20602
parent62b9fc5940c2bc20035e648cb97dd23fa9a7b5d9 (diff)
downloadnewlib-2ef1d3aa9ab65844a79385a17cb68e13ef686103.zip
newlib-2ef1d3aa9ab65844a79385a17cb68e13ef686103.tar.gz
newlib-2ef1d3aa9ab65844a79385a17cb68e13ef686103.tar.bz2
* pinfo.cc (commune_process): Don't add extra \0 to cmdline.
(_pinfo::cmdline): Ditto process internal.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/pinfo.cc10
2 files changed, 7 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 2ec1cab..89893fd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2006-07-19 Corinna Vinschen <corinna@vinschen.de>
+ * pinfo.cc (commune_process): Don't add extra \0 to cmdline.
+ (_pinfo::cmdline): Ditto process internal.
+
+2006-07-19 Corinna Vinschen <corinna@vinschen.de>
+
* mmap.cc (msync): Disable rounding up len. Fix bug in access check
loop.
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 93ab9b9..9440943 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -418,7 +418,7 @@ commune_process (void *arg)
case PICOM_CMDLINE:
{
sigproc_printf ("processing PICOM_CMDLINE");
- unsigned n = 1;
+ unsigned n = 0;
extern int __argc_safe;
const char *argv[__argc_safe + 1];
@@ -443,11 +443,6 @@ commune_process (void *arg)
sigproc_printf ("WriteFile arg %d failed, %E", a - argv);
break;
}
- if (!WriteFile (tothem, "", 1, &nr, NULL))
- {
- sigproc_printf ("WriteFile null failed, %E");
- break;
- }
break;
}
case PICOM_CWD:
@@ -819,7 +814,7 @@ _pinfo::cmdline (size_t& n)
}
else
{
- n = 1;
+ n = 0;
for (char **a = __argv; *a; a++)
n += strlen (*a) + 1;
char *p;
@@ -829,7 +824,6 @@ _pinfo::cmdline (size_t& n)
strcpy (p, *a);
p = strchr (p, '\0') + 1;
}
- *p = '\0';
}
return s;
}