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);
         }
       }

Reply via email to