Skip to content

Commit 987ef5a

Browse files
committed
Fix: error displaying filename with non-breaking space in long view
1 parent af73fa2 commit 987ef5a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/file_operations.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -618,17 +618,17 @@ is_range(const char *str)
618618
if (!str || !*str)
619619
return 0;
620620

621-
char *p = strchr(str, '-');
622-
if (!p)
621+
char *dash = strchr(str, '-');
622+
if (!dash)
623623
return 0;
624624

625-
*p = '\0';
626-
if (is_number(str) && (!p[1] || is_number(p + 1))) {
627-
*p = '-';
625+
*dash = '\0';
626+
if (is_number(str) && (!dash[1] || is_number(dash + 1))) {
627+
*dash = '-';
628628
return 1;
629629
}
630630

631-
*p = '-';
631+
*dash = '-';
632632
return 0;
633633
}
634634

@@ -655,8 +655,8 @@ is_valid_filename(const char *name)
655655
if ((*n == '=' && n[1] >= 'a' && n[1] <= 'z' && !n[2]) || *n == '@')
656656
return print_val_err(name, UNSAFE_MIME);
657657

658-
/* Reserved keyword (internal: bookmarks, tags, and selected files
659-
* constructs) */
658+
/* Reserved keyword (internal: bookmarks, tags, workspaces, and
659+
* selected files constructs) */
660660
if (((*n == 'b' || *n == 's') && n[1] == ':')
661661
|| strcmp(n, "sel") == 0)
662662
return print_val_err(name, UNSAFE_BTS_CONST);

src/listing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ is_utf8_name(const char *filename, size_t *bytes, size_t *ext_index)
288288
[15] = 1, [16] = 1, [17] = 1, [18] = 1, [19] = 1, [20] = 1, [21] = 1,
289289
[22] = 1, [23] = 1, [24] = 1, [25] = 1, [26] = 1, [27] = 1, [28] = 1,
290290
[29] = 1, [30] = 1, [31] = 1,
291-
/* Delete */
292-
[127] = 1,
291+
/* Delete, non-breaking space (NBSP), and soft hyphen (SHY) */
292+
[127] = 1, [160] = 1, [173] = 1,
293293
/* UTF-8 */
294294
[192] = 1, [193] = 1, [194] = 1, [195] = 1, [196] = 1, [197] = 1,
295295
[198] = 1, [199] = 1, [200] = 1, [201] = 1, [202] = 1, [203] = 1,

0 commit comments

Comments
 (0)