summaryrefslogtreecommitdiffstats
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-09-15 00:31:42 +0000
committerChristopher Faylor <me@cgf.cx>2005-09-15 00:31:42 +0000
commitfef80fce5523ebe151aedee1e1ef8efd2a86f1fe (patch)
tree6cc50712cc2ae3151c122e6fbf6a51820ba47b1f /winsup
parent59960f651d84055ca449f142e10097c273cb1a0c (diff)
downloadcygnal-fef80fce5523ebe151aedee1e1ef8efd2a86f1fe.tar.gz
cygnal-fef80fce5523ebe151aedee1e1ef8efd2a86f1fe.tar.bz2
cygnal-fef80fce5523ebe151aedee1e1ef8efd2a86f1fe.zip
* spawn.cc (av::fixup): Avoid breaking out of the wrong "loop".
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/spawn.cc37
2 files changed, 22 insertions, 19 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index dfb19cd57..e1536d00f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2005-09-14 Christopher Faylor <cgf@timesys.com>
+ * spawn.cc (av::fixup): Avoid breaking out of the wrong "loop".
+
+2005-09-14 Christopher Faylor <cgf@timesys.com>
+
* hookapi.cc (hook_or_detect_cygwin): Simplify very slightly.
* spawn.cc (av::fixup): Guard against problems reading an executable
which does not match Microsoft's documentation about PE format.
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index f82cce095..73c148e24 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -1047,25 +1047,24 @@ av::fixup (child_info_types chtype, const char *prog_arg, path_conv& real_path,
if (!buf)
goto err;
- do
- {
- myfault efault;
- if (efault.faulted ())
- {
- UnmapViewOfFile (buf);
- real_path.set_cygexec (false);
- break;
- }
- if (buf[0] == 'M' && buf[1] == 'Z')
- {
- unsigned off = (unsigned char) buf[0x18] | (((unsigned char) buf[0x19]) << 8);
- win16_exe = off < sizeof (IMAGE_DOS_HEADER);
- if (!win16_exe)
- real_path.set_cygexec (!!hook_or_detect_cygwin (buf, NULL));
- UnmapViewOfFile (buf);
- break;
- }
- } while (0);
+ {
+ myfault efault;
+ if (efault.faulted ())
+ {
+ UnmapViewOfFile (buf);
+ real_path.set_cygexec (false);
+ break;
+ }
+ if (buf[0] == 'M' && buf[1] == 'Z')
+ {
+ unsigned off = (unsigned char) buf[0x18] | (((unsigned char) buf[0x19]) << 8);
+ win16_exe = off < sizeof (IMAGE_DOS_HEADER);
+ if (!win16_exe)
+ real_path.set_cygexec (!!hook_or_detect_cygwin (buf, NULL));
+ UnmapViewOfFile (buf);
+ break;
+ }
+ }
debug_printf ("%s is possibly a script", (char *) real_path);