Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: coff.ml
- ===================================================================
- --- coff.ml (revision 195)
- +++ coff.ml (working copy)
- @@ -601,7 +601,7 @@
- else find_end (i - 1)
- in
- let l = find_end (String.length s) in
- - let rec aux0 i = if i = l then [] else match s.[i] with
- + let rec aux0 i = if i >= l then [] else match s.[i] with
- | ' ' -> aux0 (i+1)
- | '-' | '/' -> aux1 (i+1) (i+1)
- | _ -> raise Exit
- @@ -623,10 +623,11 @@
- | ' ' -> (cmd, String.sub s i0 (i - i0) :: args) :: aux0 (i+1)
- | ',' -> aux2 cmd (String.sub s i0 (i - i0) :: args) (i+1)
- | _ -> aux4 cmd args i0 (i+1)
- - and aux5 cmd args i = match s.[i] with
- - | ' ' -> (cmd,args) :: aux0 (i+1)
- - | ',' -> aux2 cmd args (i+1)
- - | _ -> raise Exit
- + and aux5 cmd args i = if i >= l then (cmd,args) :: aux0 l
- + else match s.[i] with
- + | ' ' -> (cmd,args) :: aux0 (i+1)
- + | ',' -> aux2 cmd args (i+1)
- + | _ -> raise Exit
- in
- try List.map (fun (cmd,args) -> (cmd,List.rev args)) (aux0 0)
- with _ ->
Add Comment
Please, Sign In to add comment