Flanterm LF as new line, reformat LICENSE.txt
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m40s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m40s
This commit is contained in:
52
ce/ce.c
52
ce/ce.c
@@ -330,7 +330,7 @@ static void tokenize (struct list_node_link** tokens, const char* text) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mprintf ("ERROR unknown character '%c'\r\n", *p);
|
||||
mprintf ("ERROR unknown character '%c'\n", *p);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
@@ -369,12 +369,12 @@ static void mkfile (struct context* context, char** file_paths, size_t files_cou
|
||||
const char* file_path = file_paths[i];
|
||||
|
||||
if (!path_parse (file_path, volume, &path)) {
|
||||
cprintf (context, "ERROR bad path '%s'\r\n", file_path);
|
||||
cprintf (context, "ERROR bad path '%s'\n", file_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((ret = volume_open (volume)) < 0) {
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\r\n", volume, str_status[-ret]);
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\n", volume, str_status[-ret]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -394,12 +394,12 @@ static void cat (struct context* context, char** file_paths, size_t files_count)
|
||||
const char* file_path = file_paths[i];
|
||||
|
||||
if (!path_parse (file_path, volume, &path)) {
|
||||
cprintf (context, "ERROR bad path '%s'\r\n", file_path);
|
||||
cprintf (context, "ERROR bad path '%s'\n", file_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((ret = volume_open (volume)) < 0) {
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\r\n", volume, str_status[-ret]);
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\n", volume, str_status[-ret]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ static void cat (struct context* context, char** file_paths, size_t files_count)
|
||||
|
||||
memset (buffer, 0, desc.size + 1);
|
||||
read_file (path, 0, (uint8_t*)buffer, desc.size);
|
||||
cprintf (context, "%s\r\n", buffer);
|
||||
cprintf (context, "%s\n", buffer);
|
||||
|
||||
close:
|
||||
if (buffer != NULL)
|
||||
@@ -432,26 +432,26 @@ static void ls (struct context* context, const char* path_string) {
|
||||
struct dir_entry entry;
|
||||
|
||||
if (!path_parse (path_string, volume, &path)) {
|
||||
cprintf (context, "ERROR bad path '%s'\r\n", path_string);
|
||||
cprintf (context, "ERROR bad path '%s'\n", path_string);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ret = volume_open (volume)) < 0) {
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\r\n", volume, str_status[-ret]);
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\n", volume, str_status[-ret]);
|
||||
return;
|
||||
}
|
||||
|
||||
describe (path, &desc);
|
||||
|
||||
if (desc.type != FS_DIR) {
|
||||
cprintf (context, "ERROR '%s' is not a directory\r\n", path_string);
|
||||
cprintf (context, "ERROR '%s' is not a directory\n", path_string);
|
||||
volume_close ();
|
||||
return;
|
||||
}
|
||||
|
||||
size_t entries = desc.size;
|
||||
cprintf (context, "total entries: %zu\r\n", entries);
|
||||
cprintf (context, "\r\n");
|
||||
cprintf (context, "total entries: %zu\n", entries);
|
||||
cprintf (context, "\n");
|
||||
|
||||
for (size_t entry_num = 0; entry_num < entries; entry_num++) {
|
||||
memset (&desc, 0, sizeof (desc));
|
||||
@@ -460,7 +460,7 @@ static void ls (struct context* context, const char* path_string) {
|
||||
read_dir_entry (path, &entry, entry_num);
|
||||
describe (entry.path, &desc);
|
||||
|
||||
cprintf (context, "%c %-40s %-40zu\r\n", (desc.type == FS_DIR ? 'D' : 'F'), entry.path,
|
||||
cprintf (context, "%c %-40s %-40zu\n", (desc.type == FS_DIR ? 'D' : 'F'), entry.path,
|
||||
desc.size);
|
||||
}
|
||||
|
||||
@@ -469,17 +469,17 @@ static void ls (struct context* context, const char* path_string) {
|
||||
|
||||
static void quit1 (struct context* context) {
|
||||
run = false;
|
||||
cprintf (context, "Goodbye!\r\n");
|
||||
cprintf (context, "Goodbye!\n");
|
||||
}
|
||||
|
||||
static void help (struct context* context) {
|
||||
cprintf (context, "Available commands:\r\n");
|
||||
cprintf (context, "echo <word1> <word2> <word3> ...\r\n");
|
||||
cprintf (context, "help\r\n");
|
||||
cprintf (context, "cat <file path>\r\n");
|
||||
cprintf (context, "ls <directory path>\r\n");
|
||||
cprintf (context, "mkfile <file path>\r\n");
|
||||
cprintf (context, "quit\r\n");
|
||||
cprintf (context, "Available commands:\n");
|
||||
cprintf (context, "echo <word1> <word2> <word3> ...\n");
|
||||
cprintf (context, "help\n");
|
||||
cprintf (context, "cat <file path>\n");
|
||||
cprintf (context, "ls <directory path>\n");
|
||||
cprintf (context, "mkfile <file path>\n");
|
||||
cprintf (context, "quit\n");
|
||||
}
|
||||
|
||||
static void cmd_cancel_proc (void) {
|
||||
@@ -512,19 +512,19 @@ static void execute_cmd (struct ast_cmd* cmd, struct context* context) {
|
||||
} else if (strcmp (cmd->name, "mkfile") == 0) {
|
||||
mkfile (context, cmd->args, cmd->arg_count);
|
||||
} else {
|
||||
/* cprintf (context, "ERROR unknown command '%s'\r\n", cmd->name); */
|
||||
/* cprintf (context, "ERROR unknown command '%s'\n", cmd->name); */
|
||||
char volume[VOLUME_MAX];
|
||||
const char* path;
|
||||
|
||||
if (!(path_parse (cmd->name, volume, &path))) {
|
||||
cprintf (context, "ERROR bad path '%s'\r\n", cmd->name);
|
||||
cprintf (context, "ERROR bad path '%s'\n", cmd->name);
|
||||
return;
|
||||
}
|
||||
|
||||
int pid = exec (volume, path);
|
||||
|
||||
if (pid < 0) {
|
||||
cprintf (context, "ERROR could not run '%s': %s\r\n", cmd->name, str_status[-pid]);
|
||||
cprintf (context, "ERROR could not run '%s': %s\n", cmd->name, str_status[-pid]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -542,12 +542,12 @@ static void execute_redir (struct ast_redir* redir, struct context* context) {
|
||||
int ret;
|
||||
|
||||
if (!(path_parse (redir->file_path, volume, &path))) {
|
||||
cprintf (context, "ERROR bad path '%s'\r\n", redir->file_path);
|
||||
cprintf (context, "ERROR bad path '%s'\n", redir->file_path);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ret = volume_open (volume)) < 0) {
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\r\n", volume, str_status[-ret]);
|
||||
cprintf (context, "ERROR could not open volume '%s': %s\n", volume, str_status[-ret]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ void app_main (void) {
|
||||
}
|
||||
}
|
||||
|
||||
mprintf ("\r\n");
|
||||
mprintf ("\n");
|
||||
exec_line (line_buffer);
|
||||
|
||||
line_cursor = 0;
|
||||
|
||||
@@ -630,14 +630,10 @@ static void control_sequence_parse (struct flanterm_context* ctx, uint8_t c) {
|
||||
ctx->get_cursor_pos (ctx, &x, &y);
|
||||
if (y == ctx->scroll_bottom_margin - 1) {
|
||||
ctx->scroll (ctx);
|
||||
ctx->set_cursor_pos (ctx, x, y);
|
||||
} else {
|
||||
ctx->set_cursor_pos (ctx, x, y + 1);
|
||||
}
|
||||
break;
|
||||
case '\r':
|
||||
ctx->get_cursor_pos (ctx, &x, &y);
|
||||
ctx->set_cursor_pos (ctx, 0, y);
|
||||
} else {
|
||||
ctx->set_cursor_pos (ctx, 0, y + 1);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
ctx->current_charset = 1;
|
||||
@@ -2422,9 +2418,9 @@ unicode_error:
|
||||
case '\n':
|
||||
if (y == ctx->scroll_bottom_margin - 1) {
|
||||
ctx->scroll (ctx);
|
||||
ctx->set_cursor_pos (ctx, x, y);
|
||||
ctx->set_cursor_pos (ctx, 0, y);
|
||||
} else {
|
||||
ctx->set_cursor_pos (ctx, x, y + 1);
|
||||
ctx->set_cursor_pos (ctx, 0, y + 1);
|
||||
}
|
||||
return;
|
||||
case '\b':
|
||||
@@ -2432,9 +2428,6 @@ unicode_error:
|
||||
ctx->set_cursor_pos (ctx, x - 1, y);
|
||||
}
|
||||
return;
|
||||
case '\r':
|
||||
ctx->set_cursor_pos (ctx, 0, y);
|
||||
return;
|
||||
case '\a':
|
||||
// The bell is handled by the kernel
|
||||
if (ctx->callback != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user