Fix a bug where a variable could be used without being initialized in W32.
authorPaul Smith <psmith@gnu.org>
Wed, 1 Feb 2006 13:31:25 +0000 (13:31 +0000)
committerPaul Smith <psmith@gnu.org>
Wed, 1 Feb 2006 13:31:25 +0000 (13:31 +0000)
ChangeLog
dir.c

index 5eaa94dfe98ac983e4b1d81732e3315cf65d4df6..d31150ad2bdbdb0666c8abc05213bc541a44957e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-01  Paul D. Smith  <psmith@gnu.org>
+
+       * dir.c (dir_contents_file_exists_p) [WINDOWS32]: Make sure
+       variable st is not used when it's not initialized.
+       Patch from Eli Zaretskii <eliz@gnu.org>.
+
 2006-01-31  Paul D. Smith  <psmith@gnu.org>
 
        * README.W32.template: Applied patch #4785 from
diff --git a/dir.c b/dir.c
index c1db6590cd4a351bb0e7751a42ef1f7d4a60f950..f6a03bda569ff696a13cf86b41a84fa0907c984d 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -630,13 +630,13 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
        * filesystems force a rehash always as mtime does not change
        * on directories (ugh!).
        */
-      if (dir->path_key
-         && (dir->fs_flags & FS_FAT
-             || (stat(dir->path_key, &st) == 0
-                 && st.st_mtime > dir->mtime)))
+      if (dir->path_key)
        {
-         /* reset date stamp to show most recent re-process */
-         dir->mtime = st.st_mtime;
+          if (!(dir->fs_flags & FS_FAT)
+              && (stat(dir->path_key, &st) == 0
+                  && st.st_mtime > dir->mtime))
+            /* reset date stamp to show most recent re-process */
+            dir->mtime = st.st_mtime;
 
          /* make sure directory can still be opened */
          dir->dirstream = opendir(dir->path_key);