diff options
author | Paul Smith <psmith@gnu.org> | 1999-03-26 04:04:42 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-03-26 04:04:42 +0000 |
commit | c4353af3f9b143b213644c09da5cf46ef611b250 (patch) | |
tree | a9bfafef0e2badb7a824de51c88aa01c0ac7e65f /job.c | |
parent | 8363e0496d1315d5881ebcd5ccdcead37c3f8a28 (diff) | |
download | gunmake-c4353af3f9b143b213644c09da5cf46ef611b250.tar.gz |
* Reworked function.c to use separate functions instead of a huge case stmt.
* Added new functions $(error ...) and $(warning ...) and documented same.
* In windows/dos shells, only treat \ as an escape for special chars.
Diffstat (limited to 'job.c')
-rw-r--r-- | job.c | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -2030,8 +2030,35 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr) } } else if (p[1] != '\0') - /* Copy and skip the following char. */ - *ap++ = *++p; + { +#if defined(__MSDOS__) || defined(WINDOWS32) + /* Only remove backslashes before characters special + to Unixy shells. All other backslashes are copied + verbatim, since they are probably DOS-style + directory separators. This still leaves a small + window for problems, but at least it should work + for the vast majority of naive users. */ + +#ifdef __MSDOS__ + /* A dot is only special as part of the "..." + wildcard. */ + if (strncmp (p + 1, ".\\.\\.", 5) == 0) + { + *ap++ = '.'; + *ap++ = '.'; + p += 4; + } + else +#endif + if (p[1] != '\\' && p[1] != '\'' && !isspace (p[1]) + && (index (sh_chars_sh, p[1]) == 0)) + /* back up one notch, to copy the backslash */ + --p; + +#endif /* __MSDOS__ || WINDOWS32 */ + /* Copy and skip the following char. */ + *ap++ = *++p; + } break; case '\'': |