diff options
author | Hartmut Becker <becker.ismaning@freenet.de> | 2014-08-23 17:54:21 +0200 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2014-09-07 17:40:28 -0400 |
commit | f970315766906ed789656d87720328b5513e5942 (patch) | |
tree | c1b8007ef5a0a92e721065e1ed5a4a41a07cb0f1 /job.c | |
parent | 579ee85941538b69226af55790d1c96811e2cc91 (diff) | |
download | gunmake-f970315766906ed789656d87720328b5513e5942.tar.gz |
Enhance/fix VMS multi-line support.
* job.c: split the command line at a newline.
* default.c, vmsjobs.c: change ECHO variable to a pseudo builtin,
which ensures that the VMS/DCL ECHO ("write sys$output") is used
and is correctly quoted.
* vmsjobs.c: remove unused builtin 'rm'.
Diffstat (limited to 'job.c')
-rw-r--r-- | job.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -1,5 +1,5 @@ /* Job execution and handling for GNU Make. -Copyright (C) 1988-2013 Free Software Foundation, Inc. +Copyright (C) 1988-2014 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify it under the @@ -1214,6 +1214,27 @@ start_job_command (struct child *child) char *end = 0; #ifdef VMS argv = p; + /* Although construct_command_argv contains some code for VMS, it was/is + not called/used. Please note, for VMS argv is a string (not an array + of strings) which contains the complete command line, which for + multi-line variables still includes the newlines. So detect newlines + and set 'end' (which is used for child->command_ptr) instead of + (re-)writing construct_command_argv */ + { + char *s = p; + int instring = 0; + while (*s) + { + if (*s == '"') + instring = !instring; + else if (*s == '\n' && !instring) + { + end = s; + break; + } + ++s; + } + } #else argv = construct_command_argv (p, &end, child->file, child->file->cmds->lines_flags[child->command_line - 1], |