[comp.lang.postscript] Another dumb bug in pspp

siegel@hc.DSPO.GOV (josh Siegel) (02/10/89)

This fixes a few more silly bugs on my part...  There were some
comment line trucations and I blew away existing comment indentations.

Also, if a string larger then BUFSIZ (for example, 23,000 characters long)
came in, pspp dumped.

These are now fixed.

			--Josh Siegel

diff -r -c pspp.n/pspp.l pspp/pspp.l
*** pspp.n/pspp.l	Thu Feb  9 09:37:02 1989
--- pspp/pspp.l	Thu Feb  9 09:36:41 1989
***************
*** 8,13 ****
--- 8,17 ----
  You may copy the pspp kit in whole or in part as long as you don't try to
  make money off it, or pretend that you wrote it.
  
+  Version 0.07
+     Fixed two more comment bugs.
+     Fixed a core dump when I get a string over BUFSIZ (stdio.h) long.
+ 
   Version 0.06
      Fixed comment lines getting stuck together (bug by Dave Yost).
  
***************
*** 118,123 ****
--- 122,133 ----
                      default: break;
                  }
                  i++;
+ 				if(i >= BUFSIZ-1) {
+             		yytext[i]= '\0';
+             		newline();
+             		fprintf(yyout,"%s",yytext);
+ 					i = 0;
+ 				}
              }
              yytext[i]= '\0';
              newline();
***************
*** 124,130 ****
              fprintf(yyout,"%s",yytext);
          }
  
! <PSPP>\{[ \t]*\}    { /* Yet another special case */ newline(); fprintf(yyout,yytext); }
  
  <PSPP>"def"    { /* Rule 3 */
                  if(check_flag(FLAG_DB))  
--- 134,143 ----
              fprintf(yyout,"%s",yytext);
          }
  
! <PSPP>\{[ \t]*\}    { /* Yet another special case */ 
! 		newline(); 
! 		fprintf(yyout,yytext); 
! 	}
  
  <PSPP>"def"    { /* Rule 3 */
                  if(check_flag(FLAG_DB))  
***************
*** 291,298 ****
                  parseflag(&yytext[3]);
                  neednew=1;
              }
! <PSPP>[^^]\%.*    { /* 11 */
!             yytext[yyleng-1]='\0';
              fprintf(yyout,"%s",yytext);
              neednew=1;
  		}
--- 304,311 ----
                  parseflag(&yytext[3]);
                  neednew=1;
              }
! <PSPP>[^^][ \t]*\%.*    { /* 11 */
!            /* yytext[yyleng-1]='\0'; */
              fprintf(yyout,"%s",yytext);
              neednew=1;
  		}
-- 
Josh Siegel		(siegel@hc.dspo.gov)
I like using a C-47A "puff dragon" to go shooting beer cans with.