Changeset 62 for Include


Ignore:
Timestamp:
Jan 16, 2007, 6:56:18 PM (18 years ago)
Author:
OverTaker
Message:

GetFullPathのバグを修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/IO/Path.ab

    r61 r62  
    6969    Static Function GetFullPath(path As String) As String
    7070        Dim cd As String
     71        Dim dirSepChar As String(Chr$(DirectorySeparatorChar))
     72        If IsPathRooted(path) Then Return path
     73
    7174        cd.ReSize = GetCurrentDirectory(0, 0) - 1
    7275        GetCurrentDirectory(cd.Length + 1, cd)
    73 
    74         Dim dirSepChar As String(Chr$(DirectorySeparatorChar))
    7576        Return cd + dirSepChar + path
    7677    End Function
     
    128129
    129130    Static Function getLastSeparatorPosision(ByRef path As String) As Long
     131        Dim lastSepPos As Long
    130132        Dim dirSepChar As String(Chr$(DirectorySeparatorChar))
    131         Dim lastSepPos As Long
     133        Dim altDirSepChar As String(Chr$(AltDirectorySeparatorChar))
     134        Dim volSepChar As String(Chr$(VolumeSeparatorChar))
    132135        lastSepPos = path.LastIndexOf(dirSepChar)
     136        If lastSepPos <> -1 Then Return lastSepPos
    133137
    134         If lastSepPos = -1 Then
    135             Dim volSepChar As String(Chr$(VolumeSeparatorChar))
    136             lastSepPos = path.LastIndexOf(volSepChar)
    137         End If
     138        lastSepPos = path.LastIndexOf(dirSepChar)
     139        If lastSepPos <> -1 Then Return lastSepPos
     140
     141        lastSepPos = path.LastIndexOf(volSepChar)
    138142        Return lastSepPos
    139143    End Function
Note: See TracChangeset for help on using the changeset viewer.