develooper Front page | perl.perl5.porters | Postings from December 2000

Re: [ID 20001214.011] Unreachable value in a search list logicalname

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
December 14, 2000 17:11
Subject:
Re: [ID 20001214.011] Unreachable value in a search list logicalname
Message ID:
p04330100b65efbe32f30@[172.16.52.1]
At 3:33 PM -0600 12/14/00, Jarkko Hietaniemi wrote:
>*cough*
>Changing a nice symbolic value to a naughty hardcoded value?
>*cough* :-)

Get something for that cough :-).

>(I do understand what's the bug but I dislike naked numbers without
>  explanations...)

Yes, I suppose the fact that the vendor supplied a confusing symbolic
name for the value we didn't want (leading us to believe we wanted
it) and none at all for the one we did want is no excuse, though
laziness can be contagious (clearly you've never been exposed) :-).
Thanks to Peter for testing.  This against 8102 puts clothes on the
naked number:

--- vms/vms.c;-0        Fri Dec  8 14:28:19 2000
+++ vms/vms.c   Thu Dec 14 17:07:01 2000
@@ -98,6 +98,9 @@
  #define expand_wild_cards(a,b,c,d)     mp_expand_wild_cards(aTHX_ a,b,c,d)
  #define getredirection(a,b)            mp_getredirection(aTHX_ a,b)

+/* see system service docs for $TRNLNM -- NOT the same as LNM$_MAX_INDEX */
+#define PERL_LNM_MAX_ALLOWED_INDEX 127
+
  static char *__mystrtolower(char *str)
  {
    if (str) for (; *str; ++str) *str= tolower(*str);
@@ -152,7 +155,7 @@
      }
  #endif

-    if (!lnm || !eqv || idx > LNM$_MAX_INDEX) {
+    if (!lnm || !eqv || idx > PERL_LNM_MAX_ALLOWED_INDEX) {
        set_errno(EINVAL); set_vaxc_errno(SS$_BADPARAM); return 0;
      }
      for (cp1 = (char *)lnm, cp2 = uplnm; *cp1; cp1++, cp2++) {
[end of patch]
-- 
____________________________________________
Craig A. Berry
mailto:craig.berry@psinetcs.com

Thread Previous | Thread Next


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