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

[PATCH 5.5.660] VMS %ENV-handling fixup (fwd)

From:
Dan Sugalski
Date:
February 29, 2000 08:30
Subject:
[PATCH 5.5.660] VMS %ENV-handling fixup (fwd)
Message ID:
Pine.LNX.4.10.10002291136200.27068-100000@tuatha.sidhe.org
VMS' logicals are limited to 255 characters, and attempting to set
them to a longer value will fail. This patch automagically truncates
the value to 255 and emits a warning if warnings are enabled.

--- vms/vms.c;1	Mon Feb 28 01:47:08 2000
+++ vms/vms.c	Tue Feb 29 11:03:01 2000
@@ -616,6 +616,12 @@
         }
         else {
           if (!*eqv) eqvdsc.dsc$w_length = 1;
+	  if (eqvdsc.dsc$w_length > LNM$C_NAMLENGTH) {
+	    eqvdsc.dsc$w_length = LNM$C_NAMLENGTH;
+	    if (ckWARN(WARN_MISC)) {
+	      Perl_warner(aTHX_ WARN_MISC,"Value of logical \"%s\" too long. Truncating to %i bytes",lnm, LNM$C_NAMLENGTH);
+	    }
+	  }
           retsts = lib$set_logical(&lnmdsc,&eqvdsc,tabvec[0],0,0);
         }
       }




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