bug-gnustep
[Top][All Lists]
Advanced

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

[bug #32094] [NSString stringByStandardizingPath] doesn't work well with


From: Sergey Golovin
Subject: [bug #32094] [NSString stringByStandardizingPath] doesn't work well with any path beginning with extra slashes
Date: Tue, 11 Jan 2011 07:35:26 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.2.13) Gecko/20101206 Ubuntu/9.10 (karmic) Firefox/3.6.13

URL:
  <http://savannah.gnu.org/bugs/?32094>

                 Summary: [NSString stringByStandardizingPath] doesn't work
well with any path beginning with extra slashes 
                 Project: GNUstep
            Submitted by: svg
            Submitted on: Втр 11 Янв 2011 10:35:25
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

If the path string contains extra slashes at the start (e.g. ///path/to/file)
then [NSString stringByStandardizingPath] returns one extra slash in the
result.

The attached test case makes following output:

2011-01-11 10:18:27.004 nsstring[25192] /path//to/file/ -> /path/to/file
2011-01-11 10:18:27.005 nsstring[25192] //path//to/file/ -> //path/to/file
2011-01-11 10:18:27.005 nsstring[25192] ///path//to/file/ -> //path/to/file
2011-01-11 10:18:27.005 nsstring[25192] ////path//to/file/ -> //path/to/file
2011-01-11 10:18:27.005 nsstring[25192] /path//to/file -> /path/to/file
2011-01-11 10:18:27.005 nsstring[25192] //path//to/file -> //path/to/file
2011-01-11 10:18:27.005 nsstring[25192] ///path//to/file -> //path/to/file
2011-01-11 10:18:27.005 nsstring[25192] ////path//to/file -> //path/to/file

, which is wrong.

The attached patch fixes the problem for me. The function rootOf() is changed
because it executes the windows specific code even on my Ubuntu which leads to
the wrong results for the pathes like an UNC resource (but not supposed to be
the resource path), e.g. "//path/to/file/".




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Втр 11 Янв 2011 10:35:25  Name: testcase.tar.bz2  Size: 620B  
By: svg
The test case and the patch
<http://savannah.gnu.org/bugs/download.php?file_id=22387>
-------------------------------------------------------
Date: Втр 11 Янв 2011 10:35:25  Name:
gs_base_NSString_stringByStandardizingPath.patch  Size: 868B   By: svg
The test case and the patch
<http://savannah.gnu.org/bugs/download.php?file_id=22388>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?32094>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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