libguestfs/SOURCES/0050-mlcustomize-Trim-whitespaces-from-commands-read-from.patch

30 lines
960 B
Diff
Raw Normal View History

From 931846b8f08e5e763141cadfc5e9b194b69303e3 Mon Sep 17 00:00:00 2001
From: Martin Kletzander <mkletzan@redhat.com>
Date: Mon, 24 Feb 2020 13:12:03 +0100
Subject: [PATCH] mlcustomize: Trim whitespaces from commands read from file
(RHBZ#1351000)
The first split does not care about the whole string, it is just trying to get
the command name in front, so triml is just right.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
generator/customize.ml | 1 +
1 file changed, 1 insertion(+)
diff --git a/generator/customize.ml b/generator/customize.ml
index c278347c1..0b256e2d2 100644
--- a/generator/customize.ml
+++ b/generator/customize.ml
@@ -873,6 +873,7 @@ let rec argspec () =
pr " ] in
let lines = read_whole_file filename in
let lines = String.lines_split lines in
+ let lines = List.map String.triml lines in
let lines = List.filter (
fun line ->
String.length line > 0 && line.[0] <> '#'
--
2.18.4