mirror of
https://github.com/mirror/make.git
synced 2024-12-27 13:20:34 +08:00
* Lots of bug fixes and cleanup; new i18n files, etc.
This commit is contained in:
parent
e5c40f6e5a
commit
4a5550c822
97
ChangeLog
97
ChangeLog
@ -1,3 +1,100 @@
|
||||
2000-05-31 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* remake.c (name_mtime): Check for stat failures. Retry if EINTR.
|
||||
|
||||
2000-05-24 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (decode_switches): The "positive_int" switch uses atoi()
|
||||
which succeeds for any input, and doesn't notice if extra,
|
||||
non-digit text is after the number. This causes make to mis-parse
|
||||
command lines like "make -j 5foo" as "make -j5" (ignoring "foo"
|
||||
completely) instead of "make -j0 5foo" (where "5foo" is a
|
||||
target). Fix this by checking the value by hand. We could use
|
||||
strtol() if we were sure of having it; this is the only
|
||||
questionable use of atoi() I found so we'll just stick with that.
|
||||
Fixes PR/1716.
|
||||
|
||||
* i18n/ja.po, i18n/nl.po, i18n/pt_BR.po: New translation files.
|
||||
* configure.in (ALL_LINGUAS): Added pt_BR.
|
||||
|
||||
2000-05-22 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* remake.c (f_mtime): Fix bug when handling future odd
|
||||
timestamps in the WINDOWS32 case. Do not bother initializing
|
||||
static var to zero. Simplify code that works around WINDOWS32
|
||||
and __MSDOS__ time skew brain damage.
|
||||
|
||||
2000-05-22 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* job.c: Don't include time.h, as make.h already does this.
|
||||
|
||||
2000-05-22 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* configure.in (AC_CHECK_HEADERS): Add sys/time.h.
|
||||
(AC_HEADER_TIME): Add.
|
||||
(clock_gettime): Prefer -lrt to -lposix4, for Solaris 7.
|
||||
(gettimeofday): Add check for standard version of gettimeofday.
|
||||
This merges changes written by Paul D. Smith.
|
||||
|
||||
* file.c (file_timestamp_now): Use gettimeofday if available
|
||||
and if clock_gettime does not work. Don't bother with
|
||||
high-resolution clocks if file timestamps have only one-second
|
||||
resolution.
|
||||
|
||||
* make.h <sys/time.h>: Include, conditionally on the usual
|
||||
TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H macros. This is needed
|
||||
for gettimeofday.
|
||||
|
||||
2000-05-20 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* read.c (read_makefile): We weren't keeping makefile names around
|
||||
unless there was a rule defined in them; but now we need to keep
|
||||
them for variables as well. Forget trying to be fancy: just keep
|
||||
every makefile name we successfully open.
|
||||
|
||||
* remote-cstms.c (start_remote_job_p): Change DB_EXTRA (?) to DB_JOBS.
|
||||
|
||||
2000-05-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* commands.c (chop_commands): Ensure ctype macro args are nonnegative.
|
||||
* expand.c (variable_expand_string): Likewise.
|
||||
* function.c (subst_expand, lookup_function, msdos_openpipe):
|
||||
Likewise.
|
||||
* job.c (vms_redirect, start_job_command, new_job, child_execute_job,
|
||||
construct_command_argv_internal, construct_command_argv): Likewise.
|
||||
* main.c (decode_env_switches, quote_for_env): Likewise.
|
||||
* misc.c (collapse_continuations, end_of_token, end_of_token_w32,
|
||||
next_token): Likewise.
|
||||
* read.c (read_makefile, do_define, conditional_line,
|
||||
find_char_unquote,get_next_mword): Likewise.
|
||||
* variable.c (try_variable_definition): Likewise.
|
||||
* vpath.c (construct_vpath_list): Likewise.
|
||||
* w32/pathstuff.c (convert_vpath_to_windows32): Likewise.
|
||||
|
||||
2000-05-10 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* main.c (main) [__MSDOS__]: Add SIGFPE to signals we block when
|
||||
running child programs, to prevent Make from dying on Windows 9X
|
||||
when the child triggers an FP exception.
|
||||
|
||||
2000-05-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* dir.c (find_directory) [WINDOWS32]: If we strip a trailing "\"
|
||||
from the directory name, remember to add it back. The argument
|
||||
might really be inside a longer string (e.g. %Path%) and if you
|
||||
don't restore the "\" it'll be truncated permanently. Fixes PR/1722.
|
||||
Reported by <steven@surfcast.com>
|
||||
|
||||
2000-05-02 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* job.c (construct_command_argv_internal) [WINDOWS32]: Added "rd"
|
||||
and "rmdir" to the list of command.com commands.
|
||||
Reported by Elod Horvath <Elod_Horvath@lnotes5.bankofny.com>
|
||||
|
||||
2000-04-24 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* i18n/ja.po: New translation file from the Japanese language team.
|
||||
|
||||
2000-04-18 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (f_mtime): If ar_member_date() returns -1 (the member
|
||||
|
39
acinclude.m4
39
acinclude.m4
@ -500,24 +500,29 @@ AC_DEFUN(fp_WITH_GETTEXT, [
|
||||
if test $enable_nls = yes; then
|
||||
AC_DEFINE(ENABLE_NLS)
|
||||
|
||||
AC_ARG_WITH(catgets,
|
||||
[ --with-catgets say that catgets is not supported],
|
||||
[AC_MSG_WARN([catgets not supported, --with-catgets ignored])])
|
||||
|
||||
AC_CHECK_FUNCS(gettext)
|
||||
AC_CHECK_LIB(intl, gettext, :)
|
||||
if test $ac_cv_lib_intl_gettext$ac_cv_func_gettext != nono; then
|
||||
AC_MSG_CHECKING(whether the included gettext is preferred)
|
||||
AC_ARG_WITH(included-gettext,
|
||||
[ --without-included-gettext avoid our provided version of gettext],
|
||||
with_included_gettext=$withval, with_included_gettext=yes)
|
||||
AC_MSG_RESULT($with_included_gettext)
|
||||
if test $with_included_gettext$ac_cv_func_gettext = nono; then
|
||||
LIBS="$LIBS -lintl"
|
||||
fi
|
||||
else
|
||||
with_included_gettext=yes
|
||||
# We don't support catgets at all
|
||||
if test "x$with_catgets" != x; then
|
||||
AC_MSG_WARN([catgets not supported, --with-catgets ignored])
|
||||
fi
|
||||
|
||||
fp_keep_LIBS="$LIBS"
|
||||
|
||||
# Look around for gettext() on the system
|
||||
AC_SEARCH_LIBS(gettext, intl)
|
||||
if test $ac_cv_search_gettext = no; then
|
||||
with_included_gettext=yes
|
||||
else
|
||||
# We only want to deal with GNU's gettext; if we don't have that
|
||||
# we'll just use our own, thanks very much.
|
||||
AC_MSG_CHECKING(for GNU gettext)
|
||||
AC_TRY_LINK(,[extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr;],
|
||||
with_included_gettext=no, with_included_gettext=yes)
|
||||
case "$with_included_gettext" in
|
||||
no) AC_MSG_RESULT(yes) ;;
|
||||
yes) AC_MSG_RESULT([no; using local copy]); LIBS="$fp_keep_LIBS" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test $with_included_gettext = yes; then
|
||||
LIBOBJS="$LIBOBJS gettext.o"
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
|
@ -300,7 +300,7 @@ chop_commands (cmds)
|
||||
int flags = 0;
|
||||
|
||||
for (p = lines[idx];
|
||||
isblank (*p) || *p == '-' || *p == '@' || *p == '+';
|
||||
isblank ((unsigned char)*p) || *p == '-' || *p == '@' || *p == '+';
|
||||
++p)
|
||||
switch (*p)
|
||||
{
|
||||
|
52
configure.in
52
configure.in
@ -3,7 +3,7 @@ AC_REVISION([$Id$])
|
||||
AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required.
|
||||
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
||||
|
||||
AM_INIT_AUTOMAKE(make, 3.79)
|
||||
AM_INIT_AUTOMAKE(make, 3.79.1)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Regular configure stuff
|
||||
@ -32,12 +32,18 @@ AC_TYPE_UID_T dnl Also does gid_t.
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
|
||||
memory.h sys/timeb.h)
|
||||
memory.h sys/time.h sys/timeb.h)
|
||||
AC_PROG_CC_C_O
|
||||
AM_PROG_CC_STDC
|
||||
AC_C_CONST dnl getopt needs this.
|
||||
AC_C_INLINE dnl gettext needs this.
|
||||
AC_HEADER_STAT
|
||||
AC_HEADER_TIME
|
||||
|
||||
dnl Handle internationalization
|
||||
|
||||
ALL_LINGUAS="de es fr ja ko nl pl pt_BR ru"
|
||||
fp_WITH_GETTEXT
|
||||
|
||||
AC_STRUCT_ST_MTIM_NSEC
|
||||
jm_AC_TYPE_UINTMAX_T
|
||||
@ -57,13 +63,38 @@ changequote([,])dnl
|
||||
fi
|
||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||
|
||||
# clock_gettime is in -lposix4 in Solaris 2.6.
|
||||
AC_CHECK_LIB(posix4, clock_gettime)
|
||||
# Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
|
||||
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
|
||||
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
|
||||
if test $ac_cv_search_clock_gettime != no; then
|
||||
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
|
||||
[Define if you have the clock_gettime function.])
|
||||
fi
|
||||
|
||||
# See if we have a standard version of gettimeofday(). Since actual
|
||||
# implementations can differ, just make sure we have the most common
|
||||
# one.
|
||||
AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
|
||||
[ac_cv_func_gettimeofday=no
|
||||
AC_TRY_RUN([#include <sys/time.h>
|
||||
int main ()
|
||||
{
|
||||
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
|
||||
exit (gettimeofday (&t, 0) != 0
|
||||
|| t.tv_sec < 0 || t.tv_usec < 0);
|
||||
}],
|
||||
ac_cv_func_gettimeofday=yes,
|
||||
ac_cv_func_gettimeofday=no,
|
||||
ac_cv_func_gettimeofday="no (cross-compiling)")])
|
||||
if test $ac_cv_func_gettimeofday = yes; then
|
||||
AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
|
||||
[Define if you have a standard gettimeofday function])
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS( memmove memcpy strchr strdup psignal mkstemp mktemp fdopen \
|
||||
dup2 getcwd sigsetmask sigaction getgroups setlinebuf \
|
||||
seteuid setegid setreuid setregid pipe strerror strsignal)
|
||||
|
||||
AC_CHECK_FUNCS(memmove strchr memcpy strdup psignal mkstemp mktemp fdopen \
|
||||
clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
|
||||
setlinebuf seteuid setegid setreuid setregid pipe \
|
||||
strerror strsignal)
|
||||
AC_CHECK_SYMBOL(sys_siglist)
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_VFORK
|
||||
@ -108,11 +139,6 @@ AC_MSG_RESULT($make_cv_union_wait)
|
||||
|
||||
AC_DECL_SYS_SIGLIST
|
||||
|
||||
dnl Handle internationalization
|
||||
|
||||
ALL_LINGUAS="de es fr ko nl pl ru"
|
||||
fp_WITH_GETTEXT
|
||||
|
||||
# The presence of the following is not meant to imply
|
||||
# that make necessarily works on those systems.
|
||||
AC_CHECK_LIB(sun, getpwnam)
|
||||
|
26
dir.c
26
dir.c
@ -296,6 +296,7 @@ find_directory (name)
|
||||
register unsigned int hash = 0;
|
||||
register char *p;
|
||||
register struct directory *dir;
|
||||
int r;
|
||||
#ifdef WINDOWS32
|
||||
char* w32_path;
|
||||
char fs_label[BUFSIZ];
|
||||
@ -333,19 +334,28 @@ find_directory (name)
|
||||
/* The directory is not in the name hash table.
|
||||
Find its device and inode numbers, and look it up by them. */
|
||||
|
||||
#ifdef VMS
|
||||
if (vmsstat_dir (name, &st) < 0)
|
||||
#else
|
||||
|
||||
# ifdef WINDOWS32
|
||||
#ifdef WINDOWS32
|
||||
/* Remove any trailing '\'. Windows32 stat fails even on valid
|
||||
directories if they end in '\'. */
|
||||
if (p[-1] == '\\')
|
||||
p[-1] = '\0';
|
||||
# endif
|
||||
if (stat (name, &st) < 0)
|
||||
#endif
|
||||
{
|
||||
|
||||
#ifdef VMS
|
||||
r = vmsstat_dir (name, &st);
|
||||
#else
|
||||
r = stat (name, &st);
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/* Put back the trailing '\'. If we don't, we're permanently
|
||||
truncating the value! */
|
||||
if (p[-1] == '\0')
|
||||
p[-1] = '\\';
|
||||
#endif
|
||||
|
||||
if (r < 0)
|
||||
{
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the `contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
|
2
expand.c
2
expand.c
@ -367,7 +367,7 @@ variable_expand_string (line, string, length)
|
||||
break;
|
||||
|
||||
default:
|
||||
if (isblank (p[-1]))
|
||||
if (isblank ((unsigned char)p[-1]))
|
||||
break;
|
||||
|
||||
/* A $ followed by a random char is a variable reference:
|
||||
|
24
file.c
24
file.c
@ -569,11 +569,29 @@ set_command_state (file, state)
|
||||
FILE_TIMESTAMP
|
||||
file_timestamp_now ()
|
||||
{
|
||||
/* Don't bother with high-resolution clocks if file timestamps have
|
||||
only one-second resolution. The code below should work, but it's
|
||||
not worth the hassle of debugging it on hosts where it fails. */
|
||||
if (1 < FILE_TIMESTAMPS_PER_S)
|
||||
{
|
||||
#if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME
|
||||
struct timespec timespec;
|
||||
if (clock_gettime (CLOCK_REALTIME, ×pec) == 0)
|
||||
return FILE_TIMESTAMP_FROM_S_AND_NS (timespec.tv_sec, timespec.tv_nsec);
|
||||
{
|
||||
struct timespec timespec;
|
||||
if (clock_gettime (CLOCK_REALTIME, ×pec) == 0)
|
||||
return FILE_TIMESTAMP_FROM_S_AND_NS (timespec.tv_sec,
|
||||
timespec.tv_nsec);
|
||||
}
|
||||
#endif
|
||||
#if HAVE_GETTIMEOFDAY
|
||||
{
|
||||
struct timeval timeval;
|
||||
if (gettimeofday (&timeval, 0) == 0)
|
||||
return FILE_TIMESTAMP_FROM_S_AND_NS (timeval.tv_sec,
|
||||
timeval.tv_usec * 1000);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return FILE_TIMESTAMP_FROM_S_AND_NS (time ((time_t *) 0), 0);
|
||||
}
|
||||
|
||||
|
10
function.c
10
function.c
@ -92,10 +92,10 @@ subst_expand (o, text, subst, replace, slen, rlen, by_word, suffix_only)
|
||||
/* If we're substituting only by fully matched words,
|
||||
or only at the ends of words, check that this case qualifies. */
|
||||
if ((by_word
|
||||
&& ((p > t && !isblank (p[-1]))
|
||||
|| (p[slen] != '\0' && !isblank (p[slen]))))
|
||||
&& ((p > t && !isblank ((unsigned char)p[-1]))
|
||||
|| (p[slen] != '\0' && !isblank ((unsigned char)p[slen]))))
|
||||
|| (suffix_only
|
||||
&& (p[slen] != '\0' && !isblank (p[slen]))))
|
||||
&& (p[slen] != '\0' && !isblank ((unsigned char)p[slen]))))
|
||||
/* Struck out. Output the rest of the string that is
|
||||
no longer to be replaced. */
|
||||
o = variable_buffer_output (o, subst, slen);
|
||||
@ -235,7 +235,7 @@ lookup_function (table, s)
|
||||
|
||||
for (; table->name != NULL; ++table)
|
||||
if (table->len <= len
|
||||
&& (isblank (s[table->len]) || s[table->len] == '\0')
|
||||
&& (isblank ((unsigned char)s[table->len]) || s[table->len] == '\0')
|
||||
&& strneq (s, table->name, table->len))
|
||||
return table;
|
||||
|
||||
@ -1274,7 +1274,7 @@ msdos_openpipe (int* pipedes, int *pidp, char *text)
|
||||
extern int dos_command_running, dos_status;
|
||||
|
||||
/* Make sure not to bother processing an empty line. */
|
||||
while (isblank (*text))
|
||||
while (isblank ((unsigned char)*text))
|
||||
++text;
|
||||
if (*text == '\0')
|
||||
return 0;
|
||||
|
2301
i18n/nl.po
2301
i18n/nl.po
File diff suppressed because it is too large
Load Diff
36
job.c
36
job.c
@ -74,7 +74,6 @@ static int amiga_batch_file;
|
||||
#endif /* Amiga. */
|
||||
|
||||
#ifdef VMS
|
||||
# include <time.h>
|
||||
# ifndef __GNUC__
|
||||
# include <processes.h>
|
||||
# endif
|
||||
@ -295,10 +294,10 @@ vms_redirect (desc, fname, ibuf)
|
||||
extern char *vmsify ();
|
||||
|
||||
ibuf++;
|
||||
while (isspace (*ibuf))
|
||||
while (isspace ((unsigned char)*ibuf))
|
||||
ibuf++;
|
||||
fptr = ibuf;
|
||||
while (*ibuf && !isspace (*ibuf))
|
||||
while (*ibuf && !isspace ((unsigned char)*ibuf))
|
||||
ibuf++;
|
||||
*ibuf = 0;
|
||||
if (strcmp (fptr, "/dev/null") != 0)
|
||||
@ -890,7 +889,7 @@ start_job_command (child)
|
||||
flags |= COMMANDS_RECURSE;
|
||||
else if (*p == '-')
|
||||
child->noerror = 1;
|
||||
else if (!isblank (*p))
|
||||
else if (!isblank ((unsigned char)*p))
|
||||
break;
|
||||
++p;
|
||||
}
|
||||
@ -1411,7 +1410,8 @@ new_job (file)
|
||||
|
||||
/* Discard any preceding whitespace that has
|
||||
already been written to the output. */
|
||||
while (out > ref && isblank (out[-1]))
|
||||
while (out > ref
|
||||
&& isblank ((unsigned char)out[-1]))
|
||||
--out;
|
||||
|
||||
/* Replace it all with a single space. */
|
||||
@ -1806,7 +1806,7 @@ child_execute_job (argv, child)
|
||||
|
||||
DB (DB_JOBS, ("child_execute_job (%s)\n", argv));
|
||||
|
||||
while (isspace (*argv))
|
||||
while (isspace ((unsigned char)*argv))
|
||||
argv++;
|
||||
|
||||
if (*argv == 0)
|
||||
@ -1831,9 +1831,9 @@ child_execute_job (argv, child)
|
||||
p++;
|
||||
if (*p == '\n')
|
||||
p++;
|
||||
if (isspace (*p))
|
||||
if (isspace ((unsigned char)*p))
|
||||
{
|
||||
do { p++; } while (isspace (*p));
|
||||
do { p++; } while (isspace ((unsigned char)*p));
|
||||
p--;
|
||||
}
|
||||
*q = *p;
|
||||
@ -1993,11 +1993,11 @@ child_execute_job (argv, child)
|
||||
case '\n':
|
||||
/* At a newline, skip any whitespace around a leading $
|
||||
from the command and issue exactly one $ into the DCL. */
|
||||
while (isspace (*p))
|
||||
while (isspace ((unsigned char)*p))
|
||||
p++;
|
||||
if (*p == '$')
|
||||
p++;
|
||||
while (isspace (*p))
|
||||
while (isspace ((unsigned char)*p))
|
||||
p++;
|
||||
fwrite (p, 1, q - p, outfile);
|
||||
fputc ('$', outfile);
|
||||
@ -2397,9 +2397,9 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
|
||||
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
|
||||
"copy", "ctty", "date", "del", "dir", "echo",
|
||||
"erase", "exit", "for", "goto", "if", "if", "md",
|
||||
"mkdir", "path", "pause", "prompt", "rem", "ren",
|
||||
"rename", "set", "shift", "time", "type",
|
||||
"ver", "verify", "vol", ":", 0 };
|
||||
"mkdir", "path", "pause", "prompt", "rd", "rem",
|
||||
"ren", "rename", "rmdir", "set", "shift", "time",
|
||||
"type", "ver", "verify", "vol", ":", 0 };
|
||||
static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^";
|
||||
static char *sh_cmds_sh[] = { "cd", "eval", "exec", "exit", "login",
|
||||
"logout", "set", "umask", "wait", "while", "for",
|
||||
@ -2444,7 +2444,7 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
|
||||
*restp = NULL;
|
||||
|
||||
/* Make sure not to bother processing an empty line. */
|
||||
while (isblank (*line))
|
||||
while (isblank ((unsigned char)*line))
|
||||
++line;
|
||||
if (*line == '\0')
|
||||
return 0;
|
||||
@ -2962,12 +2962,12 @@ construct_command_argv (line, restp, file, batch_filename_ptr)
|
||||
for (;;)
|
||||
{
|
||||
while ((*cptr != 0)
|
||||
&& (isspace (*cptr)))
|
||||
&& (isspace ((unsigned char)*cptr)))
|
||||
cptr++;
|
||||
if (*cptr == 0)
|
||||
break;
|
||||
while ((*cptr != 0)
|
||||
&& (!isspace(*cptr)))
|
||||
&& (!isspace((unsigned char)*cptr)))
|
||||
cptr++;
|
||||
argc++;
|
||||
}
|
||||
@ -2981,14 +2981,14 @@ construct_command_argv (line, restp, file, batch_filename_ptr)
|
||||
for (;;)
|
||||
{
|
||||
while ((*cptr != 0)
|
||||
&& (isspace (*cptr)))
|
||||
&& (isspace ((unsigned char)*cptr)))
|
||||
cptr++;
|
||||
if (*cptr == 0)
|
||||
break;
|
||||
DB (DB_JOBS, ("argv[%d] = [%s]\n", argc, cptr));
|
||||
argv[argc++] = cptr;
|
||||
while ((*cptr != 0)
|
||||
&& (!isspace(*cptr)))
|
||||
&& (!isspace((unsigned char)*cptr)))
|
||||
cptr++;
|
||||
if (*cptr != 0)
|
||||
*cptr++ = 0;
|
||||
|
41
main.c
41
main.c
@ -853,6 +853,13 @@ int main (int argc, char ** argv)
|
||||
FATAL_SIG (SIGINT);
|
||||
FATAL_SIG (SIGTERM);
|
||||
|
||||
#ifdef __MSDOS__
|
||||
/* Windows 9X delivers FP exceptions in child programs to their
|
||||
parent! We don't want Make to die when a child divides by zero,
|
||||
so we work around that lossage by catching SIGFPE. */
|
||||
FATAL_SIG (SIGFPE);
|
||||
#endif
|
||||
|
||||
#ifdef SIGDANGER
|
||||
FATAL_SIG (SIGDANGER);
|
||||
#endif
|
||||
@ -1195,7 +1202,7 @@ int main (int argc, char ** argv)
|
||||
/* Figure out the level of recursion. */
|
||||
{
|
||||
struct variable *v = lookup_variable ("MAKELEVEL", 9);
|
||||
if (v != 0 && *v->value != '\0' && *v->value != '-')
|
||||
if (v != 0 && v->value[0] != '\0' && v->value[0] != '-')
|
||||
makelevel = (unsigned int) atoi (v->value);
|
||||
else
|
||||
makelevel = 0;
|
||||
@ -2249,9 +2256,16 @@ decode_switches (argc, argv, env)
|
||||
break;
|
||||
|
||||
case positive_int:
|
||||
if (optarg == 0 && argc > optind
|
||||
&& ISDIGIT (argv[optind][0]))
|
||||
optarg = argv[optind++];
|
||||
/* See if we have an option argument; if we do require that
|
||||
it's all digits, not something like "10foo". */
|
||||
if (optarg == 0 && argc > optind)
|
||||
{
|
||||
const char *cp;
|
||||
for (cp=argv[optind]; ISDIGIT (cp[0]); ++cp)
|
||||
;
|
||||
if (cp[0] == '\0')
|
||||
optarg = argv[optind++];
|
||||
}
|
||||
|
||||
if (!doit)
|
||||
break;
|
||||
@ -2259,11 +2273,16 @@ decode_switches (argc, argv, env)
|
||||
if (optarg != 0)
|
||||
{
|
||||
int i = atoi (optarg);
|
||||
if (i < 1)
|
||||
const char *cp;
|
||||
|
||||
/* Yes, I realize we're repeating this in some cases. */
|
||||
for (cp = optarg; ISDIGIT (cp[0]); ++cp)
|
||||
;
|
||||
|
||||
if (i < 1 || cp[0] != '\0')
|
||||
{
|
||||
if (doit)
|
||||
error (NILF, _("the `-%c' option requires a positive integral argument"),
|
||||
cs->c);
|
||||
error (NILF, _("the `-%c' option requires a positive integral argument"),
|
||||
cs->c);
|
||||
bad = 1;
|
||||
}
|
||||
else
|
||||
@ -2355,14 +2374,14 @@ decode_env_switches (envar, len)
|
||||
{
|
||||
if (*value == '\\' && value[1] != '\0')
|
||||
++value; /* Skip the backslash. */
|
||||
else if (isblank (*value))
|
||||
else if (isblank ((unsigned char)*value))
|
||||
{
|
||||
/* End of the word. */
|
||||
*p++ = '\0';
|
||||
argv[++argc] = p;
|
||||
do
|
||||
++value;
|
||||
while (isblank (*value));
|
||||
while (isblank ((unsigned char)*value));
|
||||
continue;
|
||||
}
|
||||
*p++ = *value++;
|
||||
@ -2395,7 +2414,7 @@ quote_for_env (out, in)
|
||||
{
|
||||
if (*in == '$')
|
||||
*out++ = '$';
|
||||
else if (isblank (*in) || *in == '\\')
|
||||
else if (isblank ((unsigned char)*in) || *in == '\\')
|
||||
*out++ = '\\';
|
||||
*out++ = *in++;
|
||||
}
|
||||
|
13
make.h
13
make.h
@ -72,7 +72,18 @@ Boston, MA 02111-1307, USA. */
|
||||
<sys/timeb.h>? If any does not, configure should check for it. */
|
||||
# include <sys/timeb.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef errno
|
||||
|
9
misc.c
9
misc.c
@ -120,7 +120,7 @@ collapse_continuations (line)
|
||||
if (backslash)
|
||||
{
|
||||
in = next_token (in);
|
||||
while (out > line && isblank (out[-1]))
|
||||
while (out > line && isblank ((unsigned char)out[-1]))
|
||||
--out;
|
||||
*out++ = ' ';
|
||||
}
|
||||
@ -478,7 +478,7 @@ char *
|
||||
end_of_token (s)
|
||||
char *s;
|
||||
{
|
||||
while (*s != '\0' && !isblank (*s))
|
||||
while (*s != '\0' && !isblank ((unsigned char)*s))
|
||||
++s;
|
||||
return s;
|
||||
}
|
||||
@ -495,7 +495,8 @@ end_of_token_w32 (s, stopchar)
|
||||
register char *p = s;
|
||||
register int backslash = 0;
|
||||
|
||||
while (*p != '\0' && *p != stopchar && (backslash || !isblank (*p)))
|
||||
while (*p != '\0' && *p != stopchar
|
||||
&& (backslash || !isblank ((unsigned char)*p)))
|
||||
{
|
||||
if (*p++ == '\\')
|
||||
{
|
||||
@ -522,7 +523,7 @@ next_token (s)
|
||||
{
|
||||
register char *p = s;
|
||||
|
||||
while (isblank (*p))
|
||||
while (isblank ((unsigned char)*p))
|
||||
++p;
|
||||
return p;
|
||||
}
|
||||
|
32
read.c
32
read.c
@ -293,7 +293,6 @@ read_makefile (filename, flags)
|
||||
int len, reading_target;
|
||||
int ignoring = 0, in_ignored_define = 0;
|
||||
int no_targets = 0; /* Set when reading a rule without targets. */
|
||||
int using_filename = 0;
|
||||
struct floc fileinfo;
|
||||
char *passed_filename = filename;
|
||||
|
||||
@ -319,7 +318,6 @@ read_makefile (filename, flags)
|
||||
record_files (filenames, pattern, pattern_percent, deps, \
|
||||
cmds_started, commands, commands_idx, two_colon, \
|
||||
&fi, !(flags & RM_NO_DEFAULT_GOAL)); \
|
||||
using_filename |= commands_idx > 0; \
|
||||
} \
|
||||
filenames = 0; \
|
||||
commands_idx = 0; \
|
||||
@ -550,7 +548,7 @@ read_makefile (filename, flags)
|
||||
removed), so it could be a complex variable/function
|
||||
reference that might contain blanks. */
|
||||
p = strchr (p2, '\0');
|
||||
while (isblank (p[-1]))
|
||||
while (isblank ((unsigned char)p[-1]))
|
||||
--p;
|
||||
do_define (p2, p - p2, o_file, infile, &fileinfo);
|
||||
}
|
||||
@ -562,7 +560,8 @@ read_makefile (filename, flags)
|
||||
p2 = next_token (p + 8);
|
||||
if (*p2 == '\0')
|
||||
error (&fileinfo, _("empty `override' directive"));
|
||||
if (strneq (p2, "define", 6) && (isblank (p2[6]) || p2[6] == '\0'))
|
||||
if (strneq (p2, "define", 6)
|
||||
&& (isblank ((unsigned char)p2[6]) || p2[6] == '\0'))
|
||||
{
|
||||
if (ignoring)
|
||||
in_ignored_define = 1;
|
||||
@ -577,7 +576,7 @@ read_makefile (filename, flags)
|
||||
removed), so it could be a complex variable/function
|
||||
reference that might contain blanks. */
|
||||
p = strchr (p2, '\0');
|
||||
while (isblank (p[-1]))
|
||||
while (isblank ((unsigned char)p[-1]))
|
||||
--p;
|
||||
do_define (p2, p - p2, o_override, infile, &fileinfo);
|
||||
}
|
||||
@ -702,11 +701,12 @@ read_makefile (filename, flags)
|
||||
|
||||
r = read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
|
||||
| (noerror ? RM_DONTCARE : 0)));
|
||||
if (!r && !noerror)
|
||||
error (&fileinfo, "%s: %s", name, strerror (errno));
|
||||
|
||||
if (r < 2)
|
||||
free (name);
|
||||
if (!r)
|
||||
{
|
||||
if (!noerror)
|
||||
error (&fileinfo, "%s: %s", name, strerror (errno));
|
||||
free (name);
|
||||
}
|
||||
}
|
||||
|
||||
/* Free any space allocated by conditional_line. */
|
||||
@ -726,7 +726,7 @@ read_makefile (filename, flags)
|
||||
else if (lb.buffer[0] == '\t')
|
||||
{
|
||||
p = collapsed; /* Ignore comments. */
|
||||
while (isblank (*p))
|
||||
while (isblank ((unsigned char)*p))
|
||||
++p;
|
||||
if (*p == '\0')
|
||||
/* The line is completely blank; that is harmless. */
|
||||
@ -1066,7 +1066,7 @@ read_makefile (filename, flags)
|
||||
|
||||
reading_file = 0;
|
||||
|
||||
return 1+using_filename;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Execute a `define' directive.
|
||||
@ -1108,7 +1108,7 @@ do_define (name, namelen, origin, infile, flocp)
|
||||
|
||||
p = next_token (lb.buffer);
|
||||
len = strlen (p);
|
||||
if ((len == 5 || (len > 5 && isblank (p[5])))
|
||||
if ((len == 5 || (len > 5 && isblank ((unsigned char)p[5])))
|
||||
&& strneq (p, "endef", 5))
|
||||
{
|
||||
p += 5;
|
||||
@ -1300,7 +1300,7 @@ conditional_line (line, flocp)
|
||||
{
|
||||
/* Strip blanks after the first string. */
|
||||
char *p = line++;
|
||||
while (isblank (p[-1]))
|
||||
while (isblank ((unsigned char)p[-1]))
|
||||
--p;
|
||||
*p = '\0';
|
||||
}
|
||||
@ -1824,7 +1824,7 @@ find_char_unquote (string, stopchars, blank)
|
||||
while (1)
|
||||
{
|
||||
while (*p != '\0' && strchr (stopchars, *p) == 0
|
||||
&& (!blank || !isblank (*p)))
|
||||
&& (!blank || !isblank ((unsigned char)*p)))
|
||||
++p;
|
||||
if (*p == '\0')
|
||||
break;
|
||||
@ -2257,7 +2257,7 @@ get_next_mword (buffer, delim, startp, length)
|
||||
char c;
|
||||
|
||||
/* Skip any leading whitespace. */
|
||||
while (isblank(*p))
|
||||
while (isblank ((unsigned char)*p))
|
||||
++p;
|
||||
|
||||
beg = p;
|
||||
|
50
remake.c
50
remake.c
@ -1095,7 +1095,7 @@ f_mtime (file, search)
|
||||
free (memname);
|
||||
|
||||
if (mtime == (FILE_TIMESTAMP) -1)
|
||||
/* The archive doesn't exist, so it's members don't exist either. */
|
||||
/* The archive doesn't exist, so its members don't exist either. */
|
||||
return (FILE_TIMESTAMP) -1;
|
||||
|
||||
memtime = ar_member_date (file->hname);
|
||||
@ -1148,9 +1148,27 @@ f_mtime (file, search)
|
||||
|
||||
We only need to do this once, for now. */
|
||||
|
||||
static FILE_TIMESTAMP now = 0;
|
||||
static FILE_TIMESTAMP now;
|
||||
|
||||
FILE_TIMESTAMP adjusted_mtime = mtime;
|
||||
#ifdef WINDOWS32
|
||||
/* FAT filesystems round time to the nearest even second!
|
||||
Allow for any file (NTFS or FAT) to perhaps suffer from this
|
||||
brain damage. */
|
||||
if ((FILE_TIMESTAMP_S (adjusted_mtime) & 1) == 0
|
||||
&& FILE_TIMESTAMP_NS (adjusted_mtime) == 0)
|
||||
adjusted_mtime -= FILE_TIMESTAMPS_PER_S;
|
||||
#else
|
||||
#ifdef __MSDOS__
|
||||
/* On DJGPP under Windows 98 and Windows NT, FAT filesystems can
|
||||
set file times up to 3 seconds into the future! The bug doesn't
|
||||
occur in plain DOS or in Windows 95, but we play it safe. */
|
||||
adjusted_mtime -= 3 * FILE_TIMESTAMPS_PER_S;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!clock_skew_detected
|
||||
&& mtime != (FILE_TIMESTAMP)-1 && mtime > now
|
||||
&& mtime != (FILE_TIMESTAMP)-1 && now < adjusted_mtime
|
||||
&& !file->updated)
|
||||
{
|
||||
/* This file's time appears to be in the future.
|
||||
@ -1158,22 +1176,7 @@ f_mtime (file, search)
|
||||
|
||||
now = file_timestamp_now ();
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
* FAT filesystems round time to nearest even second(!). Just
|
||||
* allow for any file (NTFS or FAT) to perhaps suffer from this
|
||||
* braindamage.
|
||||
*/
|
||||
if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now)))
|
||||
#else
|
||||
#ifdef __MSDOS__
|
||||
/* Scrupulous testing indicates that some Windows
|
||||
filesystems can set file times up to 3 sec into the future! */
|
||||
if (mtime > now + 3)
|
||||
#else
|
||||
if (mtime > now)
|
||||
#endif
|
||||
#endif
|
||||
if (now < adjusted_mtime)
|
||||
{
|
||||
char mtimebuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
|
||||
char nowbuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
|
||||
@ -1219,8 +1222,13 @@ name_mtime (name)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (stat (name, &st) < 0)
|
||||
return (FILE_TIMESTAMP) -1;
|
||||
while (stat (name, &st) != 0)
|
||||
if (errno != EINTR)
|
||||
{
|
||||
if (errno != ENOENT && errno != ENOTDIR)
|
||||
perror_with_name ("stat:", name);
|
||||
return (FILE_TIMESTAMP) -1;
|
||||
}
|
||||
|
||||
return FILE_TIMESTAMP_STAT_MODTIME (st);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ start_remote_job_p (first_p)
|
||||
Customs requires a privileged source port be used. */
|
||||
make_access ();
|
||||
|
||||
if (ISDB (DB_EXTRA))
|
||||
if (ISDB (DB_JOBS))
|
||||
Rpc_Debug(1);
|
||||
|
||||
/* Ping the daemon once to see if it is there. */
|
||||
@ -124,8 +124,8 @@ start_remote_job_p (first_p)
|
||||
status = Customs_Host (EXPORT_SAME, &permit);
|
||||
if (status != RPC_SUCCESS)
|
||||
{
|
||||
DB (DB_EXTRA, (_("Customs won't export: %s\n"),
|
||||
Rpc_ErrorMessage (status)));
|
||||
DB (DB_JOBS, (_("Customs won't export: %s\n"),
|
||||
Rpc_ErrorMessage (status)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
2000-05-24 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/options/general: Test general option processing (PR/1716).
|
||||
|
||||
2000-04-11 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/functions/strip: Test empty value to strip (PR/1689).
|
||||
|
31
tests/scripts/options/general
Normal file
31
tests/scripts/options/general
Normal file
@ -0,0 +1,31 @@
|
||||
# -*-perl-*-
|
||||
$description = "Test generic option processing.\n";
|
||||
|
||||
open(MAKEFILE, "> $makefile");
|
||||
|
||||
# The Contents of the MAKEFILE ...
|
||||
|
||||
print MAKEFILE "foo 5foo: ; \@echo \$\@\n";
|
||||
|
||||
close(MAKEFILE);
|
||||
|
||||
# TEST 0
|
||||
|
||||
&run_make_with_options($makefile, "-j 5foo", &get_logfile);
|
||||
$answer = "5foo\n";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
# TEST 0
|
||||
|
||||
# This test prints the usage string; I don't really know a good way to
|
||||
# test it. I guess I could invoke make with a known-bad option to see
|
||||
# what the usage looks like, then compare it to what I get here... :(
|
||||
|
||||
# If I were always on UNIX, I could invoke it with 2>/dev/null, then
|
||||
# just check the error code.
|
||||
|
||||
&run_make_with_options($makefile, "-j5foo 2>/dev/null", &get_logfile, 512);
|
||||
$answer = "";
|
||||
&compare_output($answer, &get_logfile(1));
|
||||
|
||||
1;
|
@ -859,7 +859,7 @@ try_variable_definition (flocp, line, origin, target_var)
|
||||
}
|
||||
|
||||
beg = next_token (line);
|
||||
while (end > beg && isblank (end[-1]))
|
||||
while (end > beg && isblank ((unsigned char)end[-1]))
|
||||
--end;
|
||||
p = next_token (p);
|
||||
|
||||
|
9
vpath.c
9
vpath.c
@ -222,7 +222,7 @@ construct_vpath_list (pattern, dirpath)
|
||||
maxelem = 2;
|
||||
p = dirpath;
|
||||
while (*p != '\0')
|
||||
if (*p++ == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||
if (*p++ == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
|
||||
++maxelem;
|
||||
|
||||
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
||||
@ -230,7 +230,7 @@ construct_vpath_list (pattern, dirpath)
|
||||
|
||||
/* Skip over any initial separators and blanks. */
|
||||
p = dirpath;
|
||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||
while (*p == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
|
||||
++p;
|
||||
|
||||
elem = 0;
|
||||
@ -241,7 +241,8 @@ construct_vpath_list (pattern, dirpath)
|
||||
|
||||
/* Find the end of this entry. */
|
||||
v = p;
|
||||
while (*p != '\0' && *p != PATH_SEPARATOR_CHAR && !isblank (*p))
|
||||
while (*p != '\0' && *p != PATH_SEPARATOR_CHAR
|
||||
&& !isblank ((unsigned char)*p))
|
||||
++p;
|
||||
|
||||
len = p - v;
|
||||
@ -274,7 +275,7 @@ construct_vpath_list (pattern, dirpath)
|
||||
}
|
||||
|
||||
/* Skip over separators and blanks between entries. */
|
||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||
while (*p == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
|
||||
++p;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ convert_vpath_to_windows32(char *Path, char to_delim)
|
||||
* contain blanks get trounced here. Use 8.3 format as a workaround.
|
||||
*/
|
||||
for (etok = Path; etok && *etok; etok++)
|
||||
if (isblank(*etok))
|
||||
if (isblank ((unsigned char) *etok))
|
||||
*etok = to_delim;
|
||||
|
||||
return (convert_Path_to_windows32(Path, to_delim));
|
||||
@ -42,7 +42,7 @@ convert_Path_to_windows32(char *Path, char to_delim)
|
||||
etok[0] = to_delim;
|
||||
p = ++etok;
|
||||
continue; /* ignore empty bucket */
|
||||
} else if (!isalpha(*p)) {
|
||||
} else if (!isalpha ((unsigned char) *p)) {
|
||||
/* found one to count, handle things like '.' */
|
||||
*etok = to_delim;
|
||||
p = ++etok;
|
||||
|
Loading…
Reference in New Issue
Block a user