develooper Front page | perl.perl5.porters | Postings from January 2005

[perl #33938] Locale::Maketext failure_handler_auto problem

From:
root @ srv03 . sparkit . no
Date:
January 26, 2005 07:22
Subject:
[perl #33938] Locale::Maketext failure_handler_auto problem
Message ID:
rt-3.0.11-33938-106481.14.1373706959072@perl.org
# New Ticket Created by  root@srv03.sparkit.no 
# Please include the string:  [perl #33938]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=33938 >


This is a bug report for perl from maybe@yes.no,
generated with the help of perlbug 1.35 running under perl v5.8.5.


-----------------------------------------------------------------
[Please enter your report here]

This patch fixes a problem with Locale::Maketext 
'failure_handler_auto' method, with regards to
parameter handling. It also fixes cases where _compile()
doesn't return a plain scalar.


--- Maketext.pm.orig    Tue Aug  3 12:13:02 2004
+++ Maketext.pm Wed Sep 22 18:59:06 2004
@@ -126,7 +126,7 @@
   # Meant to be used like:
   #  $handle->fail_with('failure_handler_auto')

-  my($handle, $phrase, @params) = @_;
+  my($handle, $phrase) = splice(@_,0,2);
   $handle->{'failure_lex'} ||= {};
   my $lex = $handle->{'failure_lex'};

@@ -134,6 +134,9 @@
   $lex->{$phrase} ||= ($value = $handle->_compile($phrase));

   # Dumbly copied from sub maketext:
+  return $$value if ref($value) eq 'SCALAR';
+  return $value unless ref($value) eq 'CODE';
+
   {
     local $SIG{'__DIE__'};
     eval { $value = &$value($handle, @_) };
@@ -173,6 +176,7 @@
   Carp::croak "maketext requires at least one parameter" unless @_ > 1;

   my($handle, $phrase) = splice(@_,0,2);
+Carp::confess("No handle/phrase") unless (defined($handle) && defined($phrase));

   # Look up the value:


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=high
---
Site configuration information for perl v5.8.5:

Configured by root at Thu Oct 14 18:14:36 CEST 2004.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=freebsd, osvers=4.9-prerelease, archname=i386-freebsd
    uname='freebsd srv03.sparkit.no 4.9-prerelease freebsd 4.9-prerelease #3: sun sep 21 20:34:32 cest 2003 root@srv02.sparkit.no:usrsrcsyscompilesparkit-4-8 i386 '
    config_args='-d -e'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
    optimize='-O',
    cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='2.95.4 20020320 [FreeBSD]', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lcrypt -lutil -lc
    perllibs=-lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.5:
    /usr/local/lib/perl5/5.8.5/i386-freebsd
    /usr/local/lib/perl5/5.8.5
    /usr/local/lib/perl5/site_perl/5.8.5/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.8.5
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.8.5:
    HOME=/root
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=no_NO.ISO_8859-1
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/usr/local/mysql/bin:/data/apps/apache2/bin:/data/apps/webapp/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About