[Libguestfs] [common PATCH] Trim whitespaces from commands read from file

Martin Kletzander mkletzan at redhat.com
Thu Jan 23 13:04:53 UTC 2020


On Thu, Jan 23, 2020 at 12:16:50PM +0100, Martin Kletzander wrote:
>Signed-off-by: Martin Kletzander <mkletzan at redhat.com>

I forgot to mention this is trying to fix the following BZ:

https://bugzilla.redhat.com/show_bug.cgi?id=1351000

>---
> mlcustomize/customize_cmdline.ml | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/mlcustomize/customize_cmdline.ml b/mlcustomize/customize_cmdline.ml
>index c062379879e2..67e85af2ad93 100644
>--- a/mlcustomize/customize_cmdline.ml
>+++ b/mlcustomize/customize_cmdline.ml
>@@ -481,6 +481,7 @@ let rec argspec () =
>     ] in
>     let lines = read_whole_file filename in
>     let lines = String.lines_split lines in
>+    let lines = List.map String.trim lines in
>     let lines = List.filter (
>       fun line ->
>         String.length line > 0 && line.[0] <> '#'
>-- 
>2.25.0
>
>_______________________________________________
>Libguestfs mailing list
>Libguestfs at redhat.com
>https://www.redhat.com/mailman/listinfo/libguestfs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20200123/093c8008/attachment.sig>


More information about the Libguestfs mailing list