diff options
-rwxr-xr-x | src/hooks/abrt-install-ccpp-hook.in | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/hooks/abrt-install-ccpp-hook.in b/src/hooks/abrt-install-ccpp-hook.in index 9c7df750..b5fac3d9 100755 --- a/src/hooks/abrt-install-ccpp-hook.in +++ b/src/hooks/abrt-install-ccpp-hook.in @@ -8,12 +8,17 @@ verbose=false DEFAULT_LOCATION=/var/spool/abrt -DUMP_LOCATION=`cat @sysconfdir@/abrt/abrt.conf | grep '^[ ]*DumpLocation'` -DUMP_LOCATION=${DUMP_LOCATION#*DumpLocation*=} -DUMP_LOCATION=${DUMP_LOCATION// /} +wspace='[ ]*' +DUMP_LOCATION=`grep "^${wspace}DumpLocation${wspace}=" @sysconfdir@/abrt/abrt.conf \ + | sed -e "s/^${wspace}DumpLocation${wspace}=${wspace}//" -e "s/${wspace}\$//"` -if [ "$DUMP_LOCATION" = "" ]; then +if [ x"$DUMP_LOCATION" = x"" ]; then DUMP_LOCATION=$DEFAULT_LOCATION +else + if [ x"${DUMP_LOCATION#* }" != x"$DUMP_LOCATION" ]; then + # DUMP_LOCATION has a space. + DUMP_LOCATION=$DEFAULT_LOCATION + fi fi PATTERN_FILE="/proc/sys/kernel/core_pattern" |