git @ Cat's Eye Technologies Befunge-93 / d60d329
Adjust detected pageheight, allowing eg/fact2.bf to compile OK. Chris Pressey 3 years ago
1 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
6464 show usage and exit if unrecognized command-line
6565 options are given
6666 exit with a non-zero exit code if an error occurs
67 when detecing pageheight, add one on the assumption
68 that the source does not end with a newline
69 (this lets some existing example programs compile)
6770
6871 v0.94: Sep 2004, Chris Pressey
6972 display correct version number
205208 exit (1);
206209 }
207210
211 /* Most Befunge-93 sources do not end with a newline. Therefore: */
212 if (pageheight < 25) pageheight++;
213
208214 if (!(fo = fopen (argv[argc - 1], "w"))) /*** Output */
209215 {
210216 printf ("Error : couldn't open '%s' for output.\n", argv[argc - 1]);
211217 exit (1);
212218 }
213219
220 printf ("Loaded %d columns by %d rows.\n", linewidth, pageheight);
214221 printf ("Compiling");
215222
216223 fprintf (fo, "/* %s converted to ANSI C from %s by bef2c */\n",