]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix compilation warning in etags.c
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Sep 2017 19:17:55 +0000 (22:17 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Sep 2017 19:17:55 +0000 (22:17 +0300)
* lib-src/etags.c (etags_mktmp) [DOS_NT]: Don't dereference a NULL
pointer.  Reported by Richard Copley <rcopley@gmail.com>.

lib-src/etags.c

index 4000f47a414b2e9e4a1c23dab9ef8406667f0d82..009cba528d75388845d6ad955017e3a1e4f06759 100644 (file)
@@ -7068,14 +7068,16 @@ etags_mktmp (void)
       errno = temp_errno;
       templt = NULL;
     }
-
 #if defined (DOS_NT)
-  /* The file name will be used in shell redirection, so it needs to have
-     DOS-style backslashes, or else the Windows shell will barf.  */
-  char *p;
-  for (p = templt; *p; p++)
-    if (*p == '/')
-      *p = '\\';
+  else
+    {
+      /* The file name will be used in shell redirection, so it needs to have
+        DOS-style backslashes, or else the Windows shell will barf.  */
+      char *p;
+      for (p = templt; *p; p++)
+       if (*p == '/')
+         *p = '\\';
+    }
 #endif
 
   return templt;