www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/09/16/13:16:59

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: One more path handling bug.
16 Sep 1998 13:16:59 -0700 :
Message-ID: <01BDE1CE.6DB912C0.cygnus.cygwin32.developers@sos>
To: "'cygwin32-developers AT cygnus DOT com'" <cygwin32-developers AT cygnus DOT com>

Hi!

bash-2.01$ pwd
/tmp/cvs-sanity
bash-2.01$ cd a
bash-2.01$ pwd
/tmp/cvs-sanity
bash-2.01$

path.cc	(nofinalslash): do not use decrement as argument of SLASH_P macro because 		of side effect.


--- path.cc.orig        Wed Sep 16 20:31:19 1998
+++ path.cc     Wed Sep 16 22:52:50 1998
@@ -2021,7 +2021,7 @@ nofinalslash (const char *src, char *dst
   int l = strlen (src);
   if (src != dst)
     memcpy (dst, src, l+1);
-  while (l > 1 && SLASH_P (dst[--l]))
+  while (l-- > 1 && SLASH_P (dst[l]))
     dst[l] = 0;
 }

-- 
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019