mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +00:00
V1.40
[FEATURE UPDATE] I changed out the memory based fat32 filesystem for one that runs on a 512mb disk img made during the make command (only get's made if the disk.img file is nonexistent) allowing files to be permanent. Also all these files combined are 67 files.. just fyi.
This commit is contained in:
@@ -618,11 +618,21 @@ static void program() {
|
||||
}
|
||||
|
||||
void cli_cmd_cc(char *args) {
|
||||
// Skip leading whitespace
|
||||
while (args && *args == ' ') args++;
|
||||
|
||||
if (!args || !*args) {
|
||||
cmd_write("Usage: cc <filename.c>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// Trim trailing whitespace
|
||||
int len = cli_strlen(args);
|
||||
while (len > 0 && (args[len-1] == ' ' || args[len-1] == '\t' || args[len-1] == '\n')) {
|
||||
args[len-1] = 0;
|
||||
len--;
|
||||
}
|
||||
|
||||
FAT32_FileHandle *fh = fat32_open(args, "r");
|
||||
if (!fh) {
|
||||
cmd_write("Error: Cannot open source file.\n");
|
||||
@@ -636,8 +646,8 @@ void cli_cmd_cc(char *args) {
|
||||
return;
|
||||
}
|
||||
|
||||
int len = fat32_read(fh, source, MAX_SOURCE - 1);
|
||||
source[len] = 0;
|
||||
int read_len = fat32_read(fh, source, MAX_SOURCE - 1);
|
||||
source[read_len] = 0;
|
||||
fat32_close(fh);
|
||||
|
||||
lexer(source);
|
||||
|
||||
Reference in New Issue
Block a user