summaryrefslogtreecommitdiff
path: root/lang/glade-gpl/files/patch-ab
blob: ae7ab74a257ea4ce9c4d2bb71a8265a357a0dff1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- Garlic/split.adb.orig	Wed May  3 19:43:33 2000
+++ Garlic/split.adb	Wed May  3 19:45:24 2000
@@ -38,8 +38,20 @@
 
 procedure Split is
 
-   Column     : Natural  := 0;
-   Max_Column : constant := 50;
+   Column          : Natural  := 0;
+   Max_Column      : constant := 65;
+   Hard_Max_Column : constant := 78;
+   Was_Space       : Boolean  := False;
+
+   procedure Print_Space_Maybe;
+
+   procedure Print_Space_Maybe is
+   begin
+      if Was_Space and then Column /= 0 then
+         Put (' ');
+         Was_Space := False;
+      end if;
+   end Print_Space_Maybe;
 
 begin
    if Argument_Count /= 1 then
@@ -50,9 +62,20 @@
          if Argument (1) (I) = ' ' and then Column >= Max_Column then
             New_Line;
             Column := 0;
+         elsif Argument (1) (I) = ' ' and then Column = 0 then
+            null;
+         elsif Column >= Hard_Max_Column then
+            New_Line;
+            Put ("--  " & Argument (1) (I));
+            Column := 5;
+         elsif Argument (1) (I) = ' ' then
+            Was_Space := True;
          else
             if Column = 0 then
                Put ("--  ");
+               Column := 4;
+            else
+               Print_Space_Maybe;
             end if;
             Put (Argument (1) (I));
             Column := Column + 1;