SA Bugzilla – Bug 1057
SpamAssassin.pm sed_path does not correctly expand __prefix__
Last modified: 2002-10-09 06:59:10 UTC
There's a bug in SpamAssassin's sed_path method that causes it to not expand the __prefix__ macro correctly. A patch is below. --- SpamAssassin.pm.dist Fri Oct 4 23:23:55 2002 +++ SpamAssassin.pm Fri Oct 4 23:24:06 2002 @@ -916,7 +916,7 @@ return undef if (!defined $path); $path =~ s/__local_rules_dir__/$self->{LOCAL_RULES_DIR} || ''/ges; $path =~ s/__def_rules_dir__/$self->{DEF_RULES_DIR} || ''/ges; - $path =~ s/__prefix__/$self->{PREFIX} || $Config{prefix}/gs; + $path =~ s/__prefix__/$self->{PREFIX} || $Config{prefix}/ges; $path =~ s/^\~([^\/]*)/$self->expand_name($1)/es; $path; }
I don't understand this btw. How can $Config{prefix} be unset or ''?
$Config{prefix} isn't unset. It comes from Perl. The problem is, without the /e option to the regexp, the '$self->{PREFIX} || $Config{prefix}' never gets evaluated as code, but just gets substituted as a string. I hit this bug because my config files live somewhere other than /usr/share/spamassassin, and weren't being found. My $Config{prefix} was correct, so I couldn't understand why SA wasn't looking there for the config files.
Subject: Re: [SAdev] SpamAssassin.pm sed_path does not correctly expand __prefix__ On Wed, Oct 09, 2002 at 07:09:44AM -0700, bugzilla-daemon@hughes-family.org wrote: > I don't understand this btw. How can $Config{prefix} be unset or ''? Module isn't loaded? $ perl -e 'print $Config{prefix},"\n"' $ perl -e 'use Config; print $Config{prefix},"\n"' /usr I haven't had time to look at the code for this yet.
no, it's definitely loaded. I think Brian's correct, so I think the bug's now fixed -- marking as such ;)