diff options
Diffstat (limited to 'source/common/adfile.c')
-rw-r--r-- | source/common/adfile.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source/common/adfile.c b/source/common/adfile.c index d971e68..2caf599 100644 --- a/source/common/adfile.c +++ b/source/common/adfile.c @@ -298,20 +298,24 @@ FlSplitInputPathname ( return (AE_NO_MEMORY); } - Substring = strrchr (DirectoryPath, '\\'); + /* Convert backslashes to slashes in the entire path */ + + UtConvertBackslashes (DirectoryPath); + + /* Backup to last slash or colon */ + + Substring = strrchr (DirectoryPath, '/'); if (!Substring) { - Substring = strrchr (DirectoryPath, '/'); - if (!Substring) - { - Substring = strrchr (DirectoryPath, ':'); - } + Substring = strrchr (DirectoryPath, ':'); } + /* Extract the simple filename */ + if (!Substring) { + Filename = FlStrdup (DirectoryPath); DirectoryPath[0] = 0; - Filename = FlStrdup (InputPath); } else { @@ -326,7 +330,6 @@ FlSplitInputPathname ( *OutDirectoryPath = DirectoryPath; *OutFilename = Filename; - return (AE_OK); } |