Skip to content

Commit

Permalink
Don't attempt to return drive on relative path
Browse files Browse the repository at this point in the history
A relative path, such as ".\icon.ico" will not return a drive name. Proceed with the original path since a UNC network path is not relevant in this case.
  • Loading branch information
joyfullservice committed Feb 1, 2023
1 parent c56706d commit 3b9809c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Version Control.accda.src/modules/modFileAccess.bas
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,13 @@ Public Function GetUncPath(strPath As String)

strUNC = strPath
strDrive = FSO.GetDriveName(strPath)
With FSO.GetDrive(strDrive)
If .DriveType = Remote Then
strUNC = Replace(strPath, strDrive, .ShareName, , 1, vbTextCompare)
End If
End With
If strDrive <> vbNullString Then
With FSO.GetDrive(strDrive)
If .DriveType = Remote Then
strUNC = Replace(strPath, strDrive, .ShareName, , 1, vbTextCompare)
End If
End With
End If
GetUncPath = strUNC

End Function
Expand Down

0 comments on commit 3b9809c

Please sign in to comment.