From e01a5cd45aceb7f1375ef09f0917788effd4450f Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Tue, 7 Nov 2000 21:23:26 +0000 Subject: [PATCH] Chop read lines in myfileopt --- ChangeLog | 4 ++++ debian/changelog | 6 ++++++ lib/myopt.c | 3 ++- scripts/dpkg-statoverride.pl | 2 +- version-nr | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98370c6d..a2607042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Nov 7 22:05:48 CET 2000 Wichert Akkerman + + * lib/myopt.c: chop read lines in myfileopt + Tue Nov 7 00:45:00 CET 2000 Wichert Akkerman * scripts/dpkg-statoverride.8: fix typos diff --git a/debian/changelog b/debian/changelog index b2d99a93..aee580b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dpkg (1.7.2) unstable; urgency=low + + * Fix parsing of configuration files + + -- Wichert Akkerman UNRELEASED + dpkg (1.7.1) unstable; urgency=medium * Fix a typo in the dpkg-statoveride manpage diff --git a/lib/myopt.c b/lib/myopt.c index 7ae3e175..bbfe0246 100644 --- a/lib/myopt.c +++ b/lib/myopt.c @@ -42,7 +42,8 @@ void myfileopt(const char* fn, const struct cmdinfo* cmdinfos) { char* opt; const struct cmdinfo *cip; - if ((linebuf[0]=='#') || (linebuf[0]=='\n')) continue; + if ((linebuf[0]=='#') || (linebuf[0]=='\n') || (linebuf[0]==0)) continue; + linebuf[strlen(linebuf)-1]=0; for (opt=linebuf;isalnum(*opt)||*opt=='-';opt++) ; if (*opt==0) opt=NULL; diff --git a/scripts/dpkg-statoverride.pl b/scripts/dpkg-statoverride.pl index d621818d..89ad080f 100755 --- a/scripts/dpkg-statoverride.pl +++ b/scripts/dpkg-statoverride.pl @@ -170,7 +170,7 @@ sub ReadOverrides { sub WriteOverrides { my ($file); - open(SO,"$admindir/statoverride-new") || &quit("cannot open new statoverride file: $!"); + open(SO,">$admindir/statoverride-new") || &quit("cannot open new statoverride file: $!"); foreach $file (keys %owner) { print SO "$owner{$file} $group{$file} $mode{$file} $file\n"; } diff --git a/version-nr b/version-nr index bd8bf882..27f9cd32 100644 --- a/version-nr +++ b/version-nr @@ -1 +1 @@ -1.7.0 +1.8.0 -- 2.39.5