Skip to content

Commit ff44823

Browse files
committed
load /etc/nuvexportrc instead of /etc/.nuvexportrc (oops)
1 parent 38bd9a7 commit ff44823

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

trunk/nuv_export/cli.pm

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/perl -w
2-
#Last Updated: 2005.02.25 (xris)
2+
#Last Updated: 2005.03.09 (xris)
33
#
44
# cli.pm
55
#
@@ -42,7 +42,7 @@ package nuv_export::cli;
4242

4343
# Load the nuvexportrc file
4444
my %rc_args;
45-
foreach my $file ($config_file, 'nuvexportrc', "$ENV{'HOME'}/.nuvexportrc", "/etc/.nuvexportrc") {
45+
foreach my $file ($config_file, 'nuvexportrc', "$ENV{'HOME'}/.nuvexportrc", "/etc/nuvexportrc") {
4646
# No file
4747
next unless ($file && -e $file);
4848
# Slurp
@@ -182,17 +182,26 @@ package nuv_export::cli;
182182
# Scan the package from parent to child, looking for matches
183183
my $path = $package;
184184
while ($path) {
185-
return $rc_args{$path}{$arg} if (defined $rc_args{$path}{$arg});
185+
if (defined $rc_args{$path}{$arg}) {
186+
#print "$arg used from $path: $rc_args{$path}{$arg}\n";
187+
return $rc_args{$path}{$arg};
188+
}
186189
last unless ($path =~ s/^.+?:://);
187190
}
188191
# Scan the package from child to parent, looking for matches
189192
$path = $package;
190193
while ($path) {
191-
return $rc_args{$path}{$arg} if (defined $rc_args{$path}{$arg});
194+
if (defined $rc_args{$path}{$arg}) {
195+
#print "$arg used from $path: $rc_args{$path}{$arg}\n";
196+
return $rc_args{$path}{$arg};
197+
}
192198
last unless ($path =~ s/::.+?$//);
193199
}
194200
# Finally, try "generic"
195-
return $rc_args{'generic'}{$arg} if (defined $rc_args{'generic'}{$arg});
201+
if (defined $rc_args{'generic'}{$arg}) {
202+
#print "$arg used from generic: $rc_args{'generic'}{$arg}\n";
203+
return $rc_args{'generic'}{$arg};
204+
}
196205
# Lastly, try "nuvexport" (or just return undef)
197206
return $rc_args{'nuvexport'}{$arg};
198207
}

0 commit comments

Comments
 (0)