/* --------------- Moved here from job.c ---------------
This file must be #included in job.c, as it accesses static functions.
-Copyright (C) 1996-2020 Free Software Foundation, Inc.
+Copyright (C) 1996-2022 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
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program. If not, see <http://www.gnu.org/licenses/>. */
+this program. If not, see <https://www.gnu.org/licenses/>. */
#include <string.h>
#include <descrip.h>
static char *
posix_parse_dq (struct token_info *token)
{
- /* Unix mode: Any imbedded \" becomes doubled.
+ /* Unix mode: Any embedded \" becomes doubled.
\t is tab, \\, \$ leading character stripped.
$ character replaced with \' unless escaped.
*/
}
INC_TOKEN_LEN_OR_BREAK;
}
- else if (*p == '$' && isalpha (p[1]))
+ else if (*p == '$' && isalpha ((unsigned char) p[1]))
{
/* A symbol we should be able to substitute */
*q++ = '\'';
}
break;
case '\'':
- /* Symbol substitution ony in double quotes */
+ /* Symbol substitution only in double quotes */
if ((p[1] == '\'') && (parse_level[nest] == '"'))
{
nest++;
*q++ = '\'';
INC_TOKEN_LEN_OR_RETURN (p);
- while ((isalnum (*p)) || (*p == '_'))
+ while ((isalnum ((unsigned char) *p)) || (*p == '_'))
{
*q++ = *p++;
INC_TOKEN_LEN_OR_BREAK;
}
/* Optional whitespace */
- if (isspace (cmd_tokens[cmd_tkn_index][0]))
+ if (isspace ((unsigned char) cmd_tokens[cmd_tkn_index][0]))
{
strcpy (&cmd[cmd_len], cmd_tokens[cmd_tkn_index]);
cmd_len += strlen (cmd_tokens[cmd_tkn_index]);
if (cmd_tkn_index == append_token)
{
free (cmd_tokens[cmd_tkn_index++]);
- if (isspace (cmd_tokens[cmd_tkn_index][0]))
+ if (isspace ((unsigned char) cmd_tokens[cmd_tkn_index][0]))
free (cmd_tokens[cmd_tkn_index++]);
free (cmd_tokens[cmd_tkn_index++]);
}
/* TODO: Should we diagnose if paren_level goes negative? */
break;
case '&':
- if (isalpha (p[1]) && !vms_unix_simulation)
+ if (isalpha ((unsigned char) p[1]) && !vms_unix_simulation)
{
/* VMS symbol substitution */
p = parse_text (&token, 0);
UPDATE_TOKEN;
break;
case ':':
- if ((p[1] == 0) || isspace (p[1]))
+ if ((p[1] == 0) || isspace ((unsigned char) p[1]))
{
/* Unix Null command - treat as comment until next command */
unix_echo_cmd = 0;
break;
default:
/* Skip repetitive whitespace */
- if (isspace (*p))
+ if (isspace ((unsigned char) *p))
{
p = parse_char (&token, 1);
token_str[0] = ' ';
UPDATE_TOKEN;
- while (isspace (*p))
+ while (isspace ((unsigned char) *p))
p++;
if (assignment_hack != 0)
assignment_hack++;
char * raw_append_file;
file_token = append_token;
file_token++;
- if (isspace (cmd_tokens[file_token][0]))
+ if (isspace ((unsigned char) cmd_tokens[file_token][0]))
file_token++;
raw_append_file = vmsify (cmd_tokens[file_token], 0);
/* VMS DCL needs a trailing dot if null file extension */
FILE *outfile;
int cmd_len;
- outfile = get_tmpfile (&child->comname,
- "sys$scratch:gnv$make_cmdXXXXXX.com");
- /* 123456789012345678901234567890 */
- if (outfile == 0)
- pfatal_with_name (_("fopen (temporary file)"));
+ outfile = get_tmpfile (&child->comname);
+
comnamelen = strlen (child->comname);
/* The whole DCL "script" is executed as one action, and it behaves as