diff options
Diffstat (limited to 'gcc/ada/a-dirval-mingw.adb')
| -rw-r--r-- | gcc/ada/a-dirval-mingw.adb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ada/a-dirval-mingw.adb b/gcc/ada/a-dirval-mingw.adb index a20ff17..93dcae1 100644 --- a/gcc/ada/a-dirval-mingw.adb +++ b/gcc/ada/a-dirval-mingw.adb @@ -39,7 +39,7 @@ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; package body Ada.Directories.Validity is Invalid_Character : constant array (Character) of Boolean := - (NUL .. US => True, + (NUL .. US | '\' => True, '/' | ':' | '*' | '?' => True, '"' | '<' | '>' | '|' => True, DEL .. NBSP => True, @@ -76,7 +76,9 @@ package body Ada.Directories.Validity is loop -- Look for the start of the next directory or file name - while Start <= Name'Last and then Name (Start) = '\' loop + while Start <= Name'Last and then + (Name (Start) = '\' or Name (Start) = '/') + loop Start := Start + 1; end loop; @@ -89,7 +91,7 @@ package body Ada.Directories.Validity is -- Look for the end of the directory/file name while Last < Name'Last loop - exit when Name (Last + 1) = '\'; + exit when Name (Last + 1) = '\' or Name (Last + 1) = '/'; Last := Last + 1; end loop; @@ -119,7 +121,7 @@ package body Ada.Directories.Validity is begin -- A file name cannot be empty, cannot contain more than 256 characters, - -- and cannot contain invalid characters, including '\' + -- and cannot contain invalid characters. if Name'Length = 0 or else Name'Length > 256 then return False; @@ -129,7 +131,7 @@ package body Ada.Directories.Validity is else Only_Spaces := True; for J in Name'Range loop - if Invalid_Character (Name (J)) or else Name (J) = '\' then + if Invalid_Character (Name (J)) then return False; elsif Name (J) /= ' ' then Only_Spaces := False; |
