diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/vi.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/editors/vi.c b/editors/vi.c index 5b5e2b0bf..7173415c8 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -1049,7 +1049,7 @@ static void colon(char *buf) | |||
1049 | #endif | 1049 | #endif |
1050 | // how many lines in text[]? | 1050 | // how many lines in text[]? |
1051 | li = count_lines(text, end - 1); | 1051 | li = count_lines(text, end - 1); |
1052 | status_line("\"%s\"%s" | 1052 | status_line("'%s'%s" |
1053 | IF_FEATURE_VI_READONLY("%s") | 1053 | IF_FEATURE_VI_READONLY("%s") |
1054 | " %dL, %dC", current_filename, | 1054 | " %dL, %dC", current_filename, |
1055 | (file_size(fn) < 0 ? " [New file]" : ""), | 1055 | (file_size(fn) < 0 ? " [New file]" : ""), |
@@ -1165,7 +1165,7 @@ static void colon(char *buf) | |||
1165 | goto ret; // nothing was inserted | 1165 | goto ret; // nothing was inserted |
1166 | // how many lines in text[]? | 1166 | // how many lines in text[]? |
1167 | li = count_lines(q, q + ch - 1); | 1167 | li = count_lines(q, q + ch - 1); |
1168 | status_line("\"%s\"" | 1168 | status_line("'%s'" |
1169 | IF_FEATURE_VI_READONLY("%s") | 1169 | IF_FEATURE_VI_READONLY("%s") |
1170 | " %dL, %dC", fn, | 1170 | " %dL, %dC", fn, |
1171 | IF_FEATURE_VI_READONLY((readonly_mode ? " [Readonly]" : ""),) | 1171 | IF_FEATURE_VI_READONLY((readonly_mode ? " [Readonly]" : ""),) |
@@ -1298,7 +1298,7 @@ static void colon(char *buf) | |||
1298 | } | 1298 | } |
1299 | #if ENABLE_FEATURE_VI_READONLY | 1299 | #if ENABLE_FEATURE_VI_READONLY |
1300 | if (readonly_mode && !useforce) { | 1300 | if (readonly_mode && !useforce) { |
1301 | status_line_bold("\"%s\" File is read only", fn); | 1301 | status_line_bold("'%s' is read only", fn); |
1302 | goto ret; | 1302 | goto ret; |
1303 | } | 1303 | } |
1304 | #endif | 1304 | #endif |
@@ -1321,9 +1321,9 @@ static void colon(char *buf) | |||
1321 | } | 1321 | } |
1322 | if (l < 0) { | 1322 | if (l < 0) { |
1323 | if (l == -1) | 1323 | if (l == -1) |
1324 | status_line_bold("\"%s\" %s", fn, strerror(errno)); | 1324 | status_line_bold("'%s' %s", fn, strerror(errno)); |
1325 | } else { | 1325 | } else { |
1326 | status_line("\"%s\" %dL, %dC", fn, li, l); | 1326 | status_line("'%s' %dL, %dC", fn, li, l); |
1327 | if (q == text && r == end - 1 && l == ch) { | 1327 | if (q == text && r == end - 1 && l == ch) { |
1328 | file_modified = 0; | 1328 | file_modified = 0; |
1329 | last_file_modified = -1; | 1329 | last_file_modified = -1; |
@@ -1735,7 +1735,7 @@ static char *char_search(char *p, const char *pat, int dir, int range) | |||
1735 | q = (char *)re_compile_pattern(pat, strlen(pat), (struct re_pattern_buffer *)&preg); | 1735 | q = (char *)re_compile_pattern(pat, strlen(pat), (struct re_pattern_buffer *)&preg); |
1736 | if (q != 0) { | 1736 | if (q != 0) { |
1737 | // The pattern was not compiled | 1737 | // The pattern was not compiled |
1738 | status_line_bold("bad search pattern: \"%s\": %s", pat, q); | 1738 | status_line_bold("bad search pattern: '%s': %s", pat, q); |
1739 | i = 0; // return p if pattern not compiled | 1739 | i = 0; // return p if pattern not compiled |
1740 | goto cs1; | 1740 | goto cs1; |
1741 | } | 1741 | } |
@@ -2503,12 +2503,12 @@ static int file_insert(const char *fn, char *p, int update_ro_status) | |||
2503 | 2503 | ||
2504 | /* Validate file */ | 2504 | /* Validate file */ |
2505 | if (stat(fn, &statbuf) < 0) { | 2505 | if (stat(fn, &statbuf) < 0) { |
2506 | status_line_bold("\"%s\" %s", fn, strerror(errno)); | 2506 | status_line_bold("'%s' %s", fn, strerror(errno)); |
2507 | goto fi0; | 2507 | goto fi0; |
2508 | } | 2508 | } |
2509 | if (!S_ISREG(statbuf.st_mode)) { | 2509 | if (!S_ISREG(statbuf.st_mode)) { |
2510 | // This is not a regular file | 2510 | // This is not a regular file |
2511 | status_line_bold("\"%s\" Not a regular file", fn); | 2511 | status_line_bold("'%s' is not a regular file", fn); |
2512 | goto fi0; | 2512 | goto fi0; |
2513 | } | 2513 | } |
2514 | if (p < text || p > end) { | 2514 | if (p < text || p > end) { |
@@ -2519,19 +2519,19 @@ static int file_insert(const char *fn, char *p, int update_ro_status) | |||
2519 | // read file to buffer | 2519 | // read file to buffer |
2520 | fd = open(fn, O_RDONLY); | 2520 | fd = open(fn, O_RDONLY); |
2521 | if (fd < 0) { | 2521 | if (fd < 0) { |
2522 | status_line_bold("\"%s\" %s", fn, strerror(errno)); | 2522 | status_line_bold("'%s' %s", fn, strerror(errno)); |
2523 | goto fi0; | 2523 | goto fi0; |
2524 | } | 2524 | } |
2525 | size = statbuf.st_size; | 2525 | size = (statbuf.st_size < INT_MAX ? (int)statbuf.st_size : INT_MAX); |
2526 | p += text_hole_make(p, size); | 2526 | p += text_hole_make(p, size); |
2527 | cnt = safe_read(fd, p, size); | 2527 | cnt = safe_read(fd, p, size); |
2528 | if (cnt < 0) { | 2528 | if (cnt < 0) { |
2529 | status_line_bold("\"%s\" %s", fn, strerror(errno)); | 2529 | status_line_bold("'%s' %s", fn, strerror(errno)); |
2530 | p = text_hole_delete(p, p + size - 1); // un-do buffer insert | 2530 | p = text_hole_delete(p, p + size - 1); // un-do buffer insert |
2531 | } else if (cnt < size) { | 2531 | } else if (cnt < size) { |
2532 | // There was a partial read, shrink unused space text[] | 2532 | // There was a partial read, shrink unused space text[] |
2533 | p = text_hole_delete(p + cnt, p + (size - cnt) - 1); // un-do buffer insert | 2533 | p = text_hole_delete(p + cnt, p + (size - cnt) - 1); // un-do buffer insert |
2534 | status_line_bold("can't read all of file \"%s\"", fn); | 2534 | status_line_bold("can't read '%s'", fn); |
2535 | } | 2535 | } |
2536 | if (cnt >= size) | 2536 | if (cnt >= size) |
2537 | file_modified++; | 2537 | file_modified++; |
@@ -3469,7 +3469,7 @@ static void do_cmd(int c) | |||
3469 | } else { | 3469 | } else { |
3470 | file_modified = 0; | 3470 | file_modified = 0; |
3471 | last_file_modified = -1; | 3471 | last_file_modified = -1; |
3472 | status_line("\"%s\" %dL, %dC", current_filename, count_lines(text, end - 1), cnt); | 3472 | status_line("'%s' %dL, %dC", current_filename, count_lines(text, end - 1), cnt); |
3473 | if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n' | 3473 | if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n' |
3474 | || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N' | 3474 | || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N' |
3475 | ) { | 3475 | ) { |
@@ -3667,7 +3667,7 @@ static void do_cmd(int c) | |||
3667 | } | 3667 | } |
3668 | if (file_modified) { | 3668 | if (file_modified) { |
3669 | if (ENABLE_FEATURE_VI_READONLY && readonly_mode) { | 3669 | if (ENABLE_FEATURE_VI_READONLY && readonly_mode) { |
3670 | status_line_bold("\"%s\" File is read only", current_filename); | 3670 | status_line_bold("'%s' is read only", current_filename); |
3671 | break; | 3671 | break; |
3672 | } | 3672 | } |
3673 | cnt = file_write(current_filename, text, end - 1); | 3673 | cnt = file_write(current_filename, text, end - 1); |