www.delorie.com/djgpp/bugs/show.cgi | search |
If a command-line response file is generated by a program which puts a Ctrl-Z (0x1a) at the end of the file (as is common for older DOS programs), then the command line processor doesn't spot this and the Ctrl-Z gets passed as an argument to the program. This is because the library file lsr/src/libc/crt0/c1args.c uses the _read() rather than the read() function to read the file, so it either needs to use read(), or it needs to explicitly stop processing the file in parse_arg() when it sees the ctrl-z.
This is solved in WIP and will be in v2.03. Here's a patch: *** src/libc/crt0/c1args.c.~1~ Sat Mar 20 23:59:50 1999 --- src/libc/crt0/c1args.c Thu Apr 15 18:14:20 1999 *************** *** 288,293 **** --- 288,296 ---- if (len < 0) len = 0; _close(f); + /* if the last character is ^Z, remove it */ + if (len > 0 && bytes[len-1] == 0x1a) + len--; /* assume 'find -print0' if the last char is a '\0' */ if (len > 0 && bytes[len-1] == '\0') al->argv[i]->arg_file = parse_print0(bytes, len);
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |