Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 1659

Show
Ignore:
Timestamp:
02/11/07 07:55:28 (2 years ago)
Author:
larsivi
Message:

Removed bogus assert, fixed length issue, closes #246, ref #251

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/util/PathUtil.d

    r1235 r1659  
    3535    be fully normalized. 
    3636 
    37     Throws: NormalizeException if the root separator is followed by .. 
     37    Throws: Exception if the root separator is followed by .. 
    3838 
    3939    Examples: 
     
    7777    int findSlashDot(char[] path, int start) { 
    7878        assert(start < path.length); 
    79         foreach(i, c; path[start..$]) { 
     79        foreach(i, c; path[start..$-1]) { 
    8080            if (c == FileConst.PathSeparatorChar) { 
    8181                if (path[start+i+1] == '.') { 
     
    186186debug (UnitTest) 
    187187{ 
     188 
    188189    unittest 
    189190    { 
     
    202203            assert (normalize ("../../foo/bar") == "../../foo/bar"); 
    203204            assert (normalize ("../../../foo/bar") == "../../../foo/bar"); 
     205            assert (normalize ("d/") == "d/"); 
    204206            } 
    205207