From f970315766906ed789656d87720328b5513e5942 Mon Sep 17 00:00:00 2001 From: Hartmut Becker Date: Sat, 23 Aug 2014 17:54:21 +0200 Subject: 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'. --- job.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'job.c') diff --git a/job.c b/job.c index f75c7f2..b3eab13 100644 --- a/job.c +++ b/job.c @@ -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], -- cgit v1.2.3