emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116721: Fix an obscure bug in fstatat on Windows 9X


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r116721: Fix an obscure bug in fstatat on Windows 9X.
Date: Mon, 10 Mar 2014 17:27:39 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116721
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2014-03-10 19:26:45 +0200
message:
  Fix an obscure bug in fstatat on Windows 9X.
  
   src/w32.c (fstatat): Don't add an extra slash if the argument ends
   with a slash: this fails the subsequent call to stat_worker on
   Windows 9X.  Reported by oslsachem <address@hidden>.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/w32.c                      w32.c-20091113204419-o5vbwnq5f7feedwu-808
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-03-10 10:31:13 +0000
+++ b/src/ChangeLog     2014-03-10 17:26:45 +0000
@@ -1,3 +1,9 @@
+2014-03-10  Eli Zaretskii  <address@hidden>
+
+       * w32.c (fstatat): Don't add an extra slash if the argument ends
+       with a slash: this fails the subsequent call to stat_worker on
+       Windows 9X.  Reported by oslsachem <address@hidden>.
+
 2014-03-10  Martin Rudalics  <address@hidden>
 
        * w32term.c (w32_read_socket): In SIZE_RESTORED case

=== modified file 'src/w32.c'
--- a/src/w32.c 2014-02-06 15:27:46 +0000
+++ b/src/w32.c 2014-03-10 17:26:45 +0000
@@ -5138,7 +5138,10 @@
 
   if (fd != AT_FDCWD)
     {
-      if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name)
+      char lastc = dir_pathname[strlen (dir_pathname) - 1];
+
+      if (_snprintf (fullname, sizeof fullname, "%s%s%s",
+                    dir_pathname, IS_DIRECTORY_SEP (lastc) ? "" : "/", name)
          < 0)
        {
          errno = ENAMETOOLONG;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]