bug-gnulib
[Top][All Lists]
Advanced

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

Re: tmpdir.c:path_search() v. VMS


From: Paul Eggert
Subject: Re: tmpdir.c:path_search() v. VMS
Date: Wed, 17 Jul 2013 06:05:09 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

On 07/15/2013 02:47 PM, Steven M. Schweda wrote:
>    Sounds safer (though still less clear than "= 0", I claim).

Thanks, I installed this:

---
 ChangeLog    | 7 +++++++
 lib/tmpdir.c | 6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9b0cccd..fac6e06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-07-17  Paul Eggert  <address@hidden>
+
+       tmpdir: fix bug in VMS port
+       * lib/tmpdir.c (path_search) [__VMS]: Never add slash.
+       See Steven M. Schweda in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00026.html>.
+
 2013-07-15  Paul Eggert  <address@hidden>
 
        tmpdir: port to VMS, to // != /, and to long dirs
diff --git a/lib/tmpdir.c b/lib/tmpdir.c
index 46768c6..97fc3ff 100644
--- a/lib/tmpdir.c
+++ b/lib/tmpdir.c
@@ -140,10 +140,10 @@ path_search (char *tmpl, size_t tmpl_len, const char 
*dir, const char *pfx,
     }
 
   dlen = strlen (dir);
-  add_slash = dlen != 0 && !ISSLASH (dir[dlen - 1]);
 #ifdef __VMS
-  if (dlen != 0 && dir[dlen - 1] == ':')
-    add_slash = false;
+  add_slash = 0;
+#else
+  add_slash = dlen != 0 && !ISSLASH (dir[dlen - 1]);
 #endif
 
   /* check we have room for "${dir}/${pfx}XXXXXX\0" */
-- 
1.7.11.7





reply via email to

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