diff --git a/src/dep.h b/src/dep.h index a86e40fa..e492a0b3 100644 --- a/src/dep.h +++ b/src/dep.h @@ -53,7 +53,7 @@ struct nameseq unsigned int staticpattern : 1; \ unsigned int need_2nd_expansion : 1; \ unsigned int ignore_automatic_vars : 1; \ - unsigned int is_explicit : 1; + unsigned int is_explicit : 1 struct dep { diff --git a/src/dir.c b/src/dir.c index d237d4bd..edabcaf8 100644 --- a/src/dir.c +++ b/src/dir.c @@ -522,14 +522,15 @@ find_directory (const char *name) #if defined(WINDOWS32) { char tem[MAXPATHLEN], *tstart, *tend; + size_t len = strlen (name); /* Remove any trailing slashes. Windows32 stat fails even on valid directories if they end in a slash. */ - memcpy (tem, name, p - name + 1); + memcpy (tem, name, len + 1); tstart = tem; if (tstart[1] == ':') tstart += 2; - for (tend = tem + (p - name - 1); + for (tend = tem + (len - 1); tend > tstart && (*tend == '/' || *tend == '\\'); tend--) *tend = '\0'; diff --git a/tests/scripts/features/include b/tests/scripts/features/include index 11e30736..16b2e8e3 100644 --- a/tests/scripts/features/include +++ b/tests/scripts/features/include @@ -288,9 +288,15 @@ unlink('hello.mk'); # Check the default makefiles... this requires us to invoke make with no # arguments. Also check MAKEFILES +if ($port_type eq 'W32') { + $defaults = "GNUmakefile\nmakefile\nMakefile\nmakefile.mak"; +} else { + $defaults = "GNUmakefile\nmakefile\nMakefile"; +} + $ENV{MAKEFILES} = 'foobar barfoo'; -run_make_with_options(undef, q!-E '%:;@echo $@' -E 'all:;' -E '-include bizbaz' -E '-include bazbiz'!, get_logfile(0)); -$answer = "bizbaz\nbazbiz\nfoobar\nbarfoo\nGNUmakefile\nmakefile\nMakefile\n#MAKE#: 'all' is up to date.\n"; +run_make_with_options(undef, ['-E', '%:;@echo $@', '-E', 'all:;', '-E', '-include bizbaz', '-E', '-include bazbiz'], get_logfile(0)); +$answer = "bizbaz\nbazbiz\nfoobar\nbarfoo\n$defaults\n#MAKE#: 'all' is up to date.\n"; &compare_output(subst_make_string($answer), &get_logfile(1)); 1; diff --git a/tests/scripts/functions/file b/tests/scripts/functions/file index a9bf1119..50948a04 100644 --- a/tests/scripts/functions/file +++ b/tests/scripts/functions/file @@ -176,15 +176,16 @@ unlink('file.out'); # 200 is the initial size of variable_buffer. # File bigger than 200 bytes causes a realloc. # The size of the file in this test not only exceeds 200 bytes, it exceeds 65k. +# Use $(info ...) here to avoid command line limitations my $s = "hello world, hello world, hello world, hello world, hello world"; my $answer = $s x 2000; create_file('file.out', $answer); run_make_test(q!# X1 := x$(file