From 45bdcc689a569890f76616fedd4c936f1b59fb55 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 3 Apr 2006 17:21:42 +0000 Subject: [PATCH] * spawn.cc (linebuf::finish): Drop argument. Don't check command line length. (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead. Accommodate change to linebuf::finish. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/spawn.cc | 15 +++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3518c5797..eda9f431e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2006-04-03 Corinna Vinschen + + * spawn.cc (linebuf::finish): Drop argument. Don't check command line + length. + (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead. + Accommodate change to linebuf::finish. + 2006-04-03 Christopher Faylor * dcrt0.cc (sm): Delete. diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 5b736b2c6..8ac3ae039 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -250,20 +250,16 @@ class linebuf void add (const char *what, int len) __attribute__ ((regparm (3))); void add (const char *what) {add (what, strlen (what));} void prepend (const char *what, int len); - void finish (bool) __attribute__ ((regparm (2))); + void finish () __attribute__ ((regparm (1))); }; void -linebuf::finish (bool cmdlenoverflow_ok) +linebuf::finish () { if (!ix) add ("", 1); else - { - if (ix-- > MAXWINCMDLEN && cmdlenoverflow_ok) - ix = MAXWINCMDLEN - 1; - buf[ix] = '\0'; - } + buf[--ix] = '\0'; } void @@ -485,7 +481,6 @@ spawn_guts (const char * prog_arg, const char *const *argv, goto out; } - bool wascygexec = real_path.iscygexec (); res = newargv.fixup (prog_arg, real_path, ext); if (res) @@ -510,7 +505,7 @@ spawn_guts (const char * prog_arg, const char *const *argv, } else { - if (wascygexec) + if (real_path.iscygexec ()) newargv.dup_all (); else { @@ -560,7 +555,7 @@ spawn_guts (const char * prog_arg, const char *const *argv, one_line.add (" ", 1); } - one_line.finish (real_path.iscygexec ()); + one_line.finish (); if (one_line.ix >= MAXWINCMDLEN) {