Navigation Menu

Skip to content

Commit

Permalink
Fix problem when setting ProductFiles with setlocale().
Browse files Browse the repository at this point in the history
  • Loading branch information
perusionmike committed Nov 26, 2000
1 parent 06cdffc commit b315828
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
17 changes: 15 additions & 2 deletions lib/Vend/Config.pm
@@ -1,6 +1,6 @@
# Config.pm - Configure Interchange
#
# $Id: Config.pm,v 1.25 2000-11-03 23:38:30 heins Exp $
# $Id: Config.pm,v 1.26 2000-11-26 08:02:08 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
Expand Down Expand Up @@ -89,6 +89,7 @@ use strict;
use vars qw(
$VERSION $C $CanTie
@Locale_directives_ary @Locale_directives_scalar
@Locale_directives_code
@Locale_directives_currency @Locale_keys_currency
);
use Safe;
Expand All @@ -103,7 +104,7 @@ BEGIN {
};
}

$VERSION = substr(q$Revision: 1.25 $, 10);
$VERSION = substr(q$Revision: 1.26 $, 10);

my %CDname;

Expand Down Expand Up @@ -170,6 +171,18 @@ qw/
AutoModifier
/ );

# These are extra routines that are run if certain directives are
# updated
# Form:
#
# [ 'Directive', \&routine, [ @args ] ],
#
# @args are optional.
#
@Locale_directives_code = (
[ 'ProductFiles', \&Vend::Data::update_productbase ],
);

my %DumpSource = (qw(
SpecialPage 1
));
Expand Down
16 changes: 14 additions & 2 deletions lib/Vend/Util.pm
@@ -1,6 +1,6 @@
# Util.pm - Interchange utility functions
#
# $Id: Util.pm,v 1.14 2000-11-12 20:52:25 heins Exp $
# $Id: Util.pm,v 1.15 2000-11-26 08:02:08 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
Expand Down Expand Up @@ -77,7 +77,7 @@ use Config;
use Fcntl;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK);
$VERSION = substr(q$Revision: 1.14 $, 10);
$VERSION = substr(q$Revision: 1.15 $, 10);

BEGIN {
eval {
Expand Down Expand Up @@ -302,6 +302,18 @@ sub setlocale {
@{$Vend::Cfg->{$_}} = split (/\s+/, $loc->{$_})
if $loc->{$_};
}

for(@Vend::Config::Locale_directives_code) {
next unless $loc->{$_->[0]};
my ($routine, $args) = @{$_}[1,2];
if($args) {
$routine->(@$args);
}
else {
$routine->();
}
}

no strict 'refs';
for(qw/LC_COLLATE LC_CTYPE LC_TIME/) {
next unless $loc->{$_};
Expand Down

0 comments on commit b315828

Please sign in to comment.