commit a3960e1f05b27f98b5e1dd81c359d5b05ef678cf
Author: Michael Andres
Date: Tue Jan 27 13:10:40 2009 +0100
Ignore trailing whitespace in content file parser.
---
tools/repo2solv.sh | 2 +-
tools/repo_content.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh
index 104b8ae..0995d33 100755
--- a/tools/repo2solv.sh
+++ b/tools/repo2solv.sh
@@ -5,7 +5,7 @@
# tries to detect the repo type and generate one SOLV file on stdout
get_DESCRDIR () {
- local d=$(grep '^DESCRDIR' content | sed 's/^DESCRDIR[[:space:]]\+\(.*\)[[:space:]]*$/\1/')
+ local d=$(grep '^DESCRDIR' content | sed 's/^DESCRDIR[[:space:]]\+\(.*[^[:space:]]\)[[:space:]]*$/\1/')
if test -z "$d"; then
echo suse/setup/desc
else
diff --git a/tools/repo_content.c b/tools/repo_content.c
index be0b5bb..4c71c42 100644
--- a/tools/repo_content.c
+++ b/tools/repo_content.c
@@ -251,7 +251,9 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
linep += strlen(linep);
if (linep == line || linep[-1] != '\n')
continue;
- *--linep = 0;
+ while ( --linep > line && ( linep[-1] == ' ' || linep[-1] == '\t' ) )
+ ; /* skip trailing ws */
+ *linep = 0;
linep = line;
/* expect "key value" lines */
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org