- 11C17FEDC3C0442C3CA93589A47F5FDC4B9AB3BAB4361A96CBFF4BBB15E031D44BFECEED59E5EA6942F552FCA67214C3FC9D956779F77B8A0E7432CA609F779F
+ C4FA36A0508048691EA823A57B90DE3BD895F10C36150FA990983AE3996EADCD1AC8A25E9D4ECECFC8B41AF9A0E7E29AC5382959BF7624FAD8185A350C2B82C5
vtools/src/vpatch.adb
(26 . 19)(26 . 15)
13 return S(S'First..S'First+Prefix'Length-1) = Prefix;
14 end;
15
16 function Path_Prefix(Pathname: String;
17 Suffix: Positive) return String is
18 function Directory_Name(Pathname: String) return String is
19 Pos: Natural := Pathname'Last;
20 begin
21 for I in 1..Suffix loop
22 Pos := Ada.Strings.Fixed.Index(Pathname, "/",
23 From => Pos,
24 Going => Ada.Strings.Backward);
25 if Pos = 0 then
26 return Pathname;
27 end if;
28 Pos := Pos - 1;
29 end loop;
30 Pos := Ada.Strings.Fixed.Index(Pathname, "/",
31 From => Pos,
32 Going => Ada.Strings.Backward);
33 if Pos = 0 then
34 return Dirs.Current_Directory;
35 end if;
36 return Pathname(Pathname'First .. Pos);
37 end;
38
(623 . 8)(619 . 8)
40 Close(In_F);
41 Dirs.Delete_File(To_F_Name);
42 else
43 if not Dirs.Exists(Path_Prefix(To_F_Name, 1)) then
44 Dirs.Create_Path(Path_Prefix(To_F_Name, 1));
45 if not Dirs.Exists(Directory_Name(To_F_Name)) then
46 Dirs.Create_Path(Directory_Name(To_F_Name));
47 end if;
48 end if;
49 case Op is
(651 . 6)(647 . 7)
51 begin
52 Read_Loop:
53 loop
54 exit Read_Loop when End_Of_File;
55 declare
56 S: String := Get_Line;
57 begin
(659 . 7)(656 . 6)
59 H: Header := Get_Header;
60 begin
61 Process_Hunks_For_Header(H);
62 exit Read_Loop when End_Of_File;
63 end;
64 else
65 Put_Line("Prelude: " & S);