diff options
author | Rolf Ebert <rolf.ebert.gcc@gmx.de> | 2008-04-14 09:39:39 +0000 |
---|---|---|
committer | Samuel Tardieu <sam@gcc.gnu.org> | 2008-04-14 09:39:39 +0000 |
commit | 57f80aa9ebf57599bc10ebba751001559eb29437 (patch) | |
tree | 67a1056587110bf07352f720a75c0bbda2308412 /gcc | |
parent | 9ff231e23ce6bb18ab8463997acf60abe5b3672a (diff) | |
download | gcc-57f80aa9ebf57599bc10ebba751001559eb29437.zip gcc-57f80aa9ebf57599bc10ebba751001559eb29437.tar.gz gcc-57f80aa9ebf57599bc10ebba751001559eb29437.tar.bz2 |
re PR ada/20822 (makeinfo cannot process gnat_ugn_unw.texi)
2008-04-14 Rolf Ebert <rolf.ebert.gcc@gmx.de>
gcc/ada/
PR ada/20822
* xgnatugn.adb (Put_Line): New procedure, ensuring Unix
line endings even on non-Unix platforms.
From-SVN: r134257
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/xgnatugn.adb | 32 |
2 files changed, 33 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6e5a4d3..39a458f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2008-04-14 Rolf Ebert <rolf.ebert.gcc@gmx.de> + + PR ada/20822 + * xgnatugn.adb (Put_Line): New procedure, ensuring Unix + line endings even on non-Unix platforms. + 2008-04-14 Samuel Tardieu <sam@rfc1149.net> PR ada/35050 diff --git a/gcc/ada/xgnatugn.adb b/gcc/ada/xgnatugn.adb index 3c45fde..ee3b07d 100644 --- a/gcc/ada/xgnatugn.adb +++ b/gcc/ada/xgnatugn.adb @@ -97,6 +97,7 @@ with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; +with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Spitbol; use GNAT.Spitbol; @@ -108,12 +109,14 @@ procedure Xgnatugn is -- Print usage information. Invoked if an invalid command line is -- encountered. - Output_File : File_Type; + subtype Sfile is Ada.Streams.Stream_IO.File_Type; + + Output_File : Sfile; -- The preprocessed output is written to this file type Input_File is record Name : VString; - Data : File_Type; + Data : Ada.Text_IO.File_Type; Line : Natural := 0; end record; -- Records information on an input file. Name and Line are used @@ -123,6 +126,10 @@ procedure Xgnatugn is -- Returns a line from Input and performs the necessary -- line-oriented checks (length, character set, trailing spaces). + procedure Put_Line (F : Sfile; S : String); + procedure Put_Line (F : Sfile; S : VString); + -- Local version of Put_Line ensures Unix style line endings + Number_Of_Warnings : Natural := 0; Number_Of_Errors : Natural := 0; Warnings_Enabled : Boolean; @@ -352,6 +359,21 @@ procedure Xgnatugn is end; end Get_Line; + -------------- + -- Put_Line -- + -------------- + + procedure Put_Line (F : Sfile; S : String) is + begin + String'Write (Stream (F), S); + Character'Write (Stream (F), ASCII.LF); + end Put_Line; + + procedure Put_Line (F : Sfile; S : VString) is + begin + Put_Line (F, To_String (S)); + end Put_Line; + ----------- -- Error -- ----------- @@ -1311,7 +1333,7 @@ begin Open (Source_File.Data, In_File, Argument (2)); exception - when Name_Error => + when Ada.Text_IO.Name_Error => Valid_Command_Line := False; end; end if; @@ -1324,7 +1346,7 @@ begin Open (Dictionary_File.Data, In_File, Argument (3)); exception - when Name_Error => + when Ada.Text_IO.Name_Error => Valid_Command_Line := False; end; end if; @@ -1349,7 +1371,7 @@ begin Create (Output_File, Out_File, S (Output_File_Name)); exception - when Name_Error | Use_Error => + when Ada.Text_IO.Name_Error | Ada.Text_IO.Use_Error => Valid_Command_Line := False; end; end if; |