about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-04-23 17:09:12 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-04-23 17:09:12 +0000
commitd296535d38deacd0da9ef70aa54fbe43caa1f6c8 (patch)
treee7ec7d23d6e22be186b5a3a4d82a6280d41f2437
parent3db1a442a478ccc8e0ad59abc03f659c049971ee (diff)
downloadzsh-d296535d38deacd0da9ef70aa54fbe43caa1f6c8.tar.gz
zsh-d296535d38deacd0da9ef70aa54fbe43caa1f6c8.tar.xz
zsh-d296535d38deacd0da9ef70aa54fbe43caa1f6c8.zip
23313: fix test for incorrect version in ZWC file
-rw-r--r--ChangeLog3
-rw-r--r--Src/parse.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 16ffa1136..bd1cd45f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-04-23  Peter Stephenson  <pws@csr.com>
 
+	* 23313: Src/parse.c: the shell didn't actually check the version
+	of ZWC files anyway.
+
 	* 23312: Src/parse.c, Src/zsh.mdd: ensure parse.c is updated
 	when version.h changes in order to pick up changes to ZWC
 	files; memset() header of wordcode file to normalise unused words.
diff --git a/Src/parse.c b/Src/parse.c
index 97eb14495..e830f870f 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -2617,9 +2617,10 @@ load_dump_header(char *nam, char *name, int err)
     }
     if (read(fd, buf, (FD_PRELEN + 1) * sizeof(wordcode)) !=
 	((FD_PRELEN + 1) * sizeof(wordcode)) ||
-	(v = (fdmagic(buf) != FD_MAGIC && fdmagic(buf) != FD_OMAGIC))) {
+	(v = (fdmagic(buf) != FD_MAGIC && fdmagic(buf) != FD_OMAGIC)) ||
+	strcmp(fdversion(buf), ZSH_VERSION)) {
 	if (err) {
-	    if (v) {
+	    if (!v) {
 		zwarnnam(nam, "zwc file has wrong version (zsh-%s): %s",
 			 fdversion(buf), name);
 	    } else