diff mbox series

[Ada] Fix s-os_lib.adb so vectorizing compilation works

Message ID 20210505082005.GA31354@adacore.com
State New
Headers show
Series [Ada] Fix s-os_lib.adb so vectorizing compilation works | expand

Commit Message

Pierre-Marie de Rodat May 5, 2021, 8:20 a.m. UTC
Fix s-os_lib.adb so vectorizing compilation works.  Without this, the
compiler crashes while compiling s-os_lib.adb.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* libgnat/s-os_lib.adb (Missed_Drive_Letter): Simplify the code.
diff mbox series

Patch

diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb
--- a/gcc/ada/libgnat/s-os_lib.adb
+++ b/gcc/ada/libgnat/s-os_lib.adb
@@ -2158,8 +2158,10 @@  package body System.OS_Lib is
          return On_Windows
            and then not Is_With_Drive (Name)
            and then (Name'Length < 2 -- not \\name case
-                     or else Name (Name'First .. Name'First + 1)
-                             /= Directory_Separator & Directory_Separator);
+                     or else Name (Name'First)
+                             /= Directory_Separator
+                     or else Name (Name'First + 1)
+                             /= Directory_Separator);
       end Missed_Drive_Letter;
 
       -----------------