-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes to bef2c & befprof #3
Conversation
Well, hello yourself! (Your nick does sound vaguely familiar...) Sorry I haven't had time to look at this PR yet, but I do have a sizeable backlog of Befunge-related stuff that I'm planning to plow through sometime this year, and fear not, I will address this as part of it. Thanks! |
np |
The good news is that, even though this did not get done 2 years ago, or last year, there is a very good chance it will get done this year, because Befunge turns 25 years old this year, and this is what my TODO list looks like as of today. |
fclose (fi); | ||
fclose (fo); | ||
if (fi) fclose (fi); | ||
if (fo) fclose (fo); | ||
if ((fi = fopen ("temp.c", "r")) != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to understand this part, I read the code and realized it defines two filehandle variables and then re-uses them for everything. Wow. This sort of coding probably seemed less odd back then than it does today.
@serprex Looks good to me. I'm going to merge this into bef2c-befprof-fixes (the new feature branch I created for this) and it will eventually make it down into develop-2018-1 (development branch for releasing a new version this year). Ideally I'd like to test all the changes on a couple of systems (AmigaDOS 1.3, MS-DOS, ...) before releasing. I assume you'e OK with the current license, etc? I'll add your name as a contributor (in the source code I guess, since this distribution doesn't seem to have a contributors list anywhere.) |
OK with current license & etc |
Double free due to double fclose
Trampoline at leftmost/topmost edges
Don't print \0 into sourcecode
Use %% instead of %c with '%' being passed in
Avoid freeing fo/fi on failure to open
I stopped into IRC a few years ago & said hello. Well, hello again. Been getting back into Befunge by writing a program that JITs Befunge code into Python bytecode (using the Python stack itself as the Befunge stack, wee segfaulting CPython's not-memory-safe bytecode)