jcs
/subtext
/amendments
/214
folder: Show filename in the prompt, fix column alignment
jcs made amendment 214 over 2 years ago
--- folder.c Fri Jul 15 23:22:49 2022
+++ folder.c Sun Jul 17 00:59:00 2022
@@ -139,7 +139,7 @@ folder_list(struct session *s)
session_flush(s);
for (n = 0; n < db->nfolders; n++) {
- session_printf(s, "%d %- 13s %s\r\n",
+ session_printf(s, "%d %- 13.13s %s\r\n",
n,
db->folders[n].name,
db->folders[n].description);
@@ -331,7 +331,7 @@ folder_list_files(struct session *s, struct folder *fo
strftime(time, sizeof(time), "%Y-%m-%d", localtime(&file.time));
- session_printf(s, "%ld %s {{#}}%- 17s %- 40s\r\n",
+ session_printf(s, "%ld %s {{#}}%- 17.17s %- 40s\r\n",
n,
time,
file.filename,
@@ -662,7 +662,7 @@ folder_file_view(struct session *s, struct folder *fol
struct session_menu_option *dopts = NULL;
FILE *fp;
char *path = NULL;
- char prompt[6 + BOARD_NAME_LENGTH + 8];
+ char prompt[6 + BOARD_NAME_LENGTH + 1 + FOLDER_FILE_FILENAME_LENGTH];
size_t n, size;
char c;
char *data;
@@ -712,8 +712,8 @@ folder_file_view(struct session *s, struct folder *fol
"\r\n[ Not viewing file contents, press 'd' to download. ]\r\n");
session_flush(s);
- snprintf(prompt, sizeof(prompt), "Files:%s:%ld", folder->name,
- file.id);
+ snprintf(prompt, sizeof(prompt), "Files:%s:%s", folder->name,
+ file.filename);
while (!done && !s->ending) {
c = session_menu(s, file.filename, prompt, dopts, nitems(opts),