Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!mcnc!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Bug fix Message-ID: <1990Dec12.214615.6126@uvaarpa.Virginia.EDU> Date: 12 Dec 90 21:46:15 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 22 Problem: Unterminated format in 'eval' causes Perl to crash. To reproduce: Run the program: eval "format STDOUT = \n"; Analysis: The loop at line 2344 in load_format in toke.c assumes that if the input buffer is exhausted it can read from the file 'rsfp'. This is not correct if the input is from an 'eval'. Fix: Replace line 2344 with: while (s < bufend || (rsfp && (s = str_gets(linestr,rsfp, 0)) != Nullch)) { This will cause the 'while' loop to terminate correctly and report a "Format not terminated" error. (This fix might not be entirely correct, since the relationship between 'in_eval' and 'rsfp' is not entirely clear to me.) Dale Dale Worley Compass, Inc. worley@compass.com -- The only constant through history is the beaurocratic mentality.