aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2007-06-15 23:09:16 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2007-06-15 23:09:16 +0000
commit2905d4073a557a30e76aab144104f3ea66b20f60 (patch)
tree04bc5e53fea4c25e8fc8a7121331b46645cac901
parentfcc9fab7a149f2baddfaf7f78ae2ee269ca8b453 (diff)
downloadpaludis-2905d4073a557a30e76aab144104f3ea66b20f60.tar.gz
paludis-2905d4073a557a30e76aab144104f3ea66b20f60.tar.xz
Strip trailing whitespace from KV config files by default
-rw-r--r--paludis/config_file.cc3
-rw-r--r--paludis/config_file.hh1
-rw-r--r--paludis/config_file.se1
3 files changed, 5 insertions, 0 deletions
diff --git a/paludis/config_file.cc b/paludis/config_file.cc
index ec2ff6a..5ee16ab 100644
--- a/paludis/config_file.cc
+++ b/paludis/config_file.cc
@@ -587,6 +587,9 @@ namespace
}
}
+ if (! opts[kvcfo_preserve_whitespace])
+ result = strip_leading(strip_trailing(result, " \t"), " \t");
+
return result;
}
}
diff --git a/paludis/config_file.hh b/paludis/config_file.hh
index c66c3e5..96a32c8 100644
--- a/paludis/config_file.hh
+++ b/paludis/config_file.hh
@@ -225,6 +225,7 @@ namespace paludis
* - Unless kvcfo_disallow_unquoted_values, unquoted values are legal.
* - Unless kvcfo_disallow_variables, variables using $foo and ${foo} are expanded.
* - Unless kvcfo_disallow_source, source path is legal.
+ * - Unless kvcfo_preserve_whitespace, leading and trailing whitespace on values is stripped.
*
* \ingroup grpkvconfigfile
* \nosubgrouping
diff --git a/paludis/config_file.se b/paludis/config_file.se
index bd8af06..3c31656 100644
--- a/paludis/config_file.se
+++ b/paludis/config_file.se
@@ -34,6 +34,7 @@ make_enum_KeyValueConfigFileOption()
key kvcfo_disallow_unquoted_values "Do not allow unquoted values"
key kvcfo_disallow_variables "Do not allow variable expansions"
key kvcfo_disallow_source "Do not allow the source command"
+ key kvcfo_preserve_whitespace "Do not strip trailing whitespace from values"
doxygen_comment << "END"
/**