implement some loads and stores

This commit is contained in:
water
2020-08-29 19:13:29 -04:00
parent 2ac07ae6bd
commit bf7a496bb0
15 changed files with 1510 additions and 211 deletions
+15
View File
@@ -199,6 +199,7 @@ char* basename_goal(char* s) {
}
}
/* Original code, has memory bug.
// back up...
for (;;) {
if (pt < input) {
@@ -211,6 +212,20 @@ char* basename_goal(char* s) {
return pt + 1; // and return one past
}
}
*/
// back up...
for (;;) {
if (pt <= input) {
return input;
}
pt--;
char c = *pt;
// until we hit a slash.
if (c == '\\' || c == '/') { // slashes
return pt + 1; // and return one past
}
}
}
/*!