Fix bug in argument parsing (RHBZ#1139790).
This commit is contained in:
parent
91c6a95e71
commit
e4cc04ad4a
@ -1,4 +1,4 @@
|
|||||||
From 9e70610b08939bef354be508eb8eec6a498ec663 Mon Sep 17 00:00:00 2001
|
From 0641f11626be99c8bde349520ac28a8d93106856 Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Tue, 1 Apr 2014 11:17:07 +0100
|
Date: Tue, 1 Apr 2014 11:17:07 +0100
|
||||||
Subject: [PATCH 09/11] arg: Add no_arg and get_arg helper functions.
|
Subject: [PATCH 09/11] arg: Add no_arg and get_arg helper functions.
|
||||||
@ -6,7 +6,7 @@ Subject: [PATCH 09/11] arg: Add no_arg and get_arg helper functions.
|
|||||||
The no_arg function in this patch is a no-op. It will do something
|
The no_arg function in this patch is a no-op. It will do something
|
||||||
useful in the followups.
|
useful in the followups.
|
||||||
|
|
||||||
The get_arg function simple checks the next position on the command
|
The get_arg function simply checks the next position on the command
|
||||||
line exists and returns that argument or raises a Arg.Missing.
|
line exists and returns that argument or raises a Arg.Missing.
|
||||||
|
|
||||||
This patch should introduce no functional change, it is simply code
|
This patch should introduce no functional change, it is simply code
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 40e1fd09162cccabe79013c9f663c1b970dee771 Mon Sep 17 00:00:00 2001
|
From 4d1defe6f017b86b0766fd02005a468bedd9aa88 Mon Sep 17 00:00:00 2001
|
||||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
Date: Tue, 1 Apr 2014 11:21:40 +0100
|
Date: Tue, 1 Apr 2014 11:21:40 +0100
|
||||||
Subject: [PATCH 10/11] arg: Allow flags such as --flag=arg as well as --flag
|
Subject: [PATCH 10/11] arg: Allow flags such as --flag=arg as well as --flag
|
||||||
@ -11,12 +11,12 @@ command line parsing libraries allow.
|
|||||||
Fix for the following issue:
|
Fix for the following issue:
|
||||||
http://caml.inria.fr/mantis/view.php?id=5197
|
http://caml.inria.fr/mantis/view.php?id=5197
|
||||||
---
|
---
|
||||||
stdlib/arg.ml | 28 ++++++++++++++++++++++------
|
stdlib/arg.ml | 30 ++++++++++++++++++++++++------
|
||||||
stdlib/arg.mli | 3 ++-
|
stdlib/arg.mli | 3 ++-
|
||||||
2 files changed, 24 insertions(+), 7 deletions(-)
|
2 files changed, 26 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/stdlib/arg.ml b/stdlib/arg.ml
|
diff --git a/stdlib/arg.ml b/stdlib/arg.ml
|
||||||
index a41e0a2..88b1306 100644
|
index a41e0a2..5ffdabc 100644
|
||||||
--- a/stdlib/arg.ml
|
--- a/stdlib/arg.ml
|
||||||
+++ b/stdlib/arg.ml
|
+++ b/stdlib/arg.ml
|
||||||
@@ -55,6 +55,12 @@ let rec assoc3 x l =
|
@@ -55,6 +55,12 @@ let rec assoc3 x l =
|
||||||
@ -32,7 +32,7 @@ index a41e0a2..88b1306 100644
|
|||||||
let make_symlist prefix sep suffix l =
|
let make_symlist prefix sep suffix l =
|
||||||
match l with
|
match l with
|
||||||
| [] -> "<none>"
|
| [] -> "<none>"
|
||||||
@@ -130,14 +136,24 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
|
@@ -130,14 +136,26 @@ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
|
||||||
while !current < l do
|
while !current < l do
|
||||||
let s = argv.(!current) in
|
let s = argv.(!current) in
|
||||||
if String.length s >= 1 && s.[0] = '-' then begin
|
if String.length s >= 1 && s.[0] = '-' then begin
|
||||||
@ -59,7 +59,9 @@ index a41e0a2..88b1306 100644
|
|||||||
+ | None ->
|
+ | None ->
|
||||||
+ if !current + 1 < l then argv.(!current + 1)
|
+ if !current + 1 < l then argv.(!current + 1)
|
||||||
+ else stop (Missing s)
|
+ else stop (Missing s)
|
||||||
+ | Some arg -> arg
|
+ | Some arg ->
|
||||||
|
+ decr current;
|
||||||
|
+ arg
|
||||||
in
|
in
|
||||||
begin try
|
begin try
|
||||||
let rec treat_action = function
|
let rec treat_action = function
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 2c490afbb343fb84930890ec552b876e6481cf0a Mon Sep 17 00:00:00 2001
|
From 6156d208e6cc6e28a964be5dd34585bd54f6eadf Mon Sep 17 00:00:00 2001
|
||||||
From: Xavier Leroy <xavier.leroy@inria.fr>
|
From: Xavier Leroy <xavier.leroy@inria.fr>
|
||||||
Date: Wed, 27 Aug 2014 09:58:33 +0000
|
Date: Wed, 27 Aug 2014 09:58:33 +0000
|
||||||
Subject: [PATCH 11/11] PR#6517: use ISO C99 types {,u}int{32,64}_t in
|
Subject: [PATCH 11/11] PR#6517: use ISO C99 types {,u}int{32,64}_t in
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
Name: ocaml
|
Name: ocaml
|
||||||
Version: 4.02.0
|
Version: 4.02.0
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
|
|
||||||
Summary: OCaml compiler and programming environment
|
Summary: OCaml compiler and programming environment
|
||||||
|
|
||||||
@ -418,6 +418,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Sep 9 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-2
|
||||||
|
- Fix bug in argument parsing (RHBZ#1139790).
|
||||||
|
|
||||||
* Sat Aug 30 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-1
|
* Sat Aug 30 2014 Richard W.M. Jones <rjones@redhat.com> - 4.02.0-1
|
||||||
- New upstream OCaml 4.02.0 final.
|
- New upstream OCaml 4.02.0 final.
|
||||||
- Add patch for ocaml-camlimages
|
- Add patch for ocaml-camlimages
|
||||||
|
Loading…
Reference in New Issue
Block a user