summaryrefslogtreecommitdiff
path: root/ext/I18N
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-01 20:21:27 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-01 20:21:27 +0000
commite1faa3a01366d845f838995ae5732544dbf4ef9a (patch)
tree0a5e5cd8384e0db9dbc69ab2a4a9b5246d20948f /ext/I18N
parent03c0f8c07963f685780114c2f82dda1f61150821 (diff)
downloadperl-e1faa3a01366d845f838995ae5732544dbf4ef9a.tar.gz
Have a little faith on nl_langinfo() itself.
p4raw-id: //depot/perl@13413
Diffstat (limited to 'ext/I18N')
-rw-r--r--ext/I18N/Langinfo/Langinfo.xs32
1 files changed, 7 insertions, 25 deletions
diff --git a/ext/I18N/Langinfo/Langinfo.xs b/ext/I18N/Langinfo/Langinfo.xs
index 3a97dafa17..f1a0a1728b 100644
--- a/ext/I18N/Langinfo/Langinfo.xs
+++ b/ext/I18N/Langinfo/Langinfo.xs
@@ -19,31 +19,13 @@ langinfo(code)
int code
CODE:
#ifdef HAS_NL_LANGINFO
- char *s;
- if (code > 0) { /* bold assumption: all valid langinfo codes > 0 */
-#ifdef _MAXSTRMSG
- if (code > _MAXSTRMSG)
- RETVAL = &PL_sv_undef;
- else
-#else
-# ifdef _NL_NUM_ITEMS
- if (code >= _NL_NUM_ITEMS)
- RETVAL = &PL_sv_undef;
- else
-# else
-# ifdef _NL_NUM
- if (code >= _NL_NUM)
- RETVAL = &PL_sv_undef;
- else
-# endif
-# endif
-#endif
- {
- s = nl_langinfo(code);
- RETVAL = newSVpvn(s, strlen(s));
- }
- } else {
- RETVAL = &PL_sv_undef;
+ {
+ char *s;
+
+ if ((s = nl_langinfo(code)))
+ RETVAL = newSVpvn(s, strlen(s));
+ else
+ RETVAL = &PL_sv_undef;
}
#else
croak("nl_langinfo() not implemented on this architecture");