summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartijn Dekker <martijn@inlv.org>2018-02-14 07:11:14 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2018-03-05 09:31:11 +0000
commit54ea6a8cd54c518e11a23275501f92806182f997 (patch)
treeaf00c8590ba118ca46588576248ec91abdedaa0d
parent14c17aa17870e83736fa479f49b338ba8dc69f6c (diff)
downloadzsh-54ea6a8cd54c518e11a23275501f92806182f997.tar.gz
zsh-54ea6a8cd54c518e11a23275501f92806182f997.tar.xz
zsh-54ea6a8cd54c518e11a23275501f92806182f997.zip
42365: Use .zwc file if timestamp identical to source.
This can happen if the files are bundled together.
-rw-r--r--ChangeLog5
-rw-r--r--Src/parse.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 463510d08..ba42b72e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-05  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* Martijn: 42365: Src/parse.c: use .zwc file if timestamp
+	identical to source file.
+
 2018-03-04  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* Taylor West: 42411: Src/mem.c: assume any current C compiler
diff --git a/Src/parse.c b/Src/parse.c
index 6af2550df..47e5a246a 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -3677,15 +3677,15 @@ try_dump_file(char *path, char *name, char *file, int *ksh, int test_only)
      * function. */
     queue_signals();
     if (!rd &&
-	(rc || std.st_mtime > stc.st_mtime) &&
-	(rn || std.st_mtime > stn.st_mtime) &&
+	(rc || std.st_mtime >= stc.st_mtime) &&
+	(rn || std.st_mtime >= stn.st_mtime) &&
 	(prog = check_dump_file(dig, &std, name, ksh, test_only))) {
 	unqueue_signals();
 	return prog;
     }
     /* No digest file. Now look for the per-function compiled file. */
     if (!rc &&
-	(rn || stc.st_mtime > stn.st_mtime) &&
+	(rn || stc.st_mtime >= stn.st_mtime) &&
 	(prog = check_dump_file(wc, &stc, name, ksh, test_only))) {
 	unqueue_signals();
 	return prog;
@@ -3724,7 +3724,7 @@ try_source_file(char *file)
     rn = stat(file, &stn);
 
     queue_signals();
-    if (!rc && (rn || stc.st_mtime > stn.st_mtime) &&
+    if (!rc && (rn || stc.st_mtime >= stn.st_mtime) &&
 	(prog = check_dump_file(wc, &stc, tail, NULL, 0))) {
 	unqueue_signals();
 	return prog;