diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/awk.c | 2 | ||||
-rw-r--r-- | editors/diff.c | 2 | ||||
-rw-r--r-- | editors/sed.c | 2 | ||||
-rw-r--r-- | editors/vi.c | 40 |
4 files changed, 23 insertions, 23 deletions
diff --git a/editors/awk.c b/editors/awk.c index 42f6ef866..3224788c0 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -155,7 +155,7 @@ typedef struct tsplitter_s { | |||
155 | 155 | ||
156 | /* simple token classes */ | 156 | /* simple token classes */ |
157 | /* Order and hex values are very important!!! See next_token() */ | 157 | /* Order and hex values are very important!!! See next_token() */ |
158 | #define TC_SEQSTART 1 /* ( */ | 158 | #define TC_SEQSTART 1 /* ( */ |
159 | #define TC_SEQTERM (1 << 1) /* ) */ | 159 | #define TC_SEQTERM (1 << 1) /* ) */ |
160 | #define TC_REGEXP (1 << 2) /* /.../ */ | 160 | #define TC_REGEXP (1 << 2) /* /.../ */ |
161 | #define TC_OUTRDR (1 << 3) /* | > >> */ | 161 | #define TC_OUTRDR (1 << 3) /* | > >> */ |
diff --git a/editors/diff.c b/editors/diff.c index 3a3334640..b08ded3a1 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -843,7 +843,7 @@ static void diffdir(char *p[2], const char *s_start) | |||
843 | * add_to_dirlist will remove it. */ | 843 | * add_to_dirlist will remove it. */ |
844 | list[i].len = strlen(p[i]); | 844 | list[i].len = strlen(p[i]); |
845 | recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS, | 845 | recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS, |
846 | add_to_dirlist, skip_dir, &list[i], 0); | 846 | add_to_dirlist, skip_dir, &list[i], 0); |
847 | /* Sort dl alphabetically. | 847 | /* Sort dl alphabetically. |
848 | * GNU diff does this ignoring any number of trailing dots. | 848 | * GNU diff does this ignoring any number of trailing dots. |
849 | * We don't, so for us dotted files almost always are | 849 | * We don't, so for us dotted files almost always are |
diff --git a/editors/sed.c b/editors/sed.c index 070af611a..f8ca5d351 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -1077,7 +1077,7 @@ static void process_files(void) | |||
1077 | /* or does this line matches our last address regex */ | 1077 | /* or does this line matches our last address regex */ |
1078 | || (sed_cmd->end_match && old_matched | 1078 | || (sed_cmd->end_match && old_matched |
1079 | && (regexec(sed_cmd->end_match, | 1079 | && (regexec(sed_cmd->end_match, |
1080 | pattern_space, 0, NULL, 0) == 0) | 1080 | pattern_space, 0, NULL, 0) == 0) |
1081 | ) | 1081 | ) |
1082 | ); | 1082 | ); |
1083 | } | 1083 | } |
diff --git a/editors/vi.c b/editors/vi.c index 821583ec1..1fc66b931 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -14,7 +14,7 @@ | |||
14 | * add :help command | 14 | * add :help command |
15 | * :map macros | 15 | * :map macros |
16 | * if mark[] values were line numbers rather than pointers | 16 | * if mark[] values were line numbers rather than pointers |
17 | * it would be easier to change the mark when add/delete lines | 17 | * it would be easier to change the mark when add/delete lines |
18 | * More intelligence in refresh() | 18 | * More intelligence in refresh() |
19 | * ":r !cmd" and "!cmd" to filter text through an external command | 19 | * ":r !cmd" and "!cmd" to filter text through an external command |
20 | * A true "undo" facility | 20 | * A true "undo" facility |
@@ -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 | } |
@@ -1929,11 +1929,11 @@ static int find_range(char **start, char **stop, char c) | |||
1929 | dot_end(); // find NL | 1929 | dot_end(); // find NL |
1930 | q = dot; | 1930 | q = dot; |
1931 | } else { | 1931 | } else { |
1932 | // nothing -- this causes any other values of c to | 1932 | // nothing -- this causes any other values of c to |
1933 | // represent the one-character range under the | 1933 | // represent the one-character range under the |
1934 | // cursor. this is correct for ' ' and 'l', but | 1934 | // cursor. this is correct for ' ' and 'l', but |
1935 | // perhaps no others. | 1935 | // perhaps no others. |
1936 | // | 1936 | // |
1937 | } | 1937 | } |
1938 | if (q < p) { | 1938 | if (q < p) { |
1939 | t = q; | 1939 | t = q; |
@@ -2512,12 +2512,12 @@ static int file_insert(const char *fn, char *p, int update_ro_status) | |||
2512 | 2512 | ||
2513 | /* Validate file */ | 2513 | /* Validate file */ |
2514 | if (stat(fn, &statbuf) < 0) { | 2514 | if (stat(fn, &statbuf) < 0) { |
2515 | status_line_bold("\"%s\" %s", fn, strerror(errno)); | 2515 | status_line_bold("'%s' %s", fn, strerror(errno)); |
2516 | goto fi0; | 2516 | goto fi0; |
2517 | } | 2517 | } |
2518 | if (!S_ISREG(statbuf.st_mode)) { | 2518 | if (!S_ISREG(statbuf.st_mode)) { |
2519 | // This is not a regular file | 2519 | // This is not a regular file |
2520 | status_line_bold("\"%s\" Not a regular file", fn); | 2520 | status_line_bold("'%s' is not a regular file", fn); |
2521 | goto fi0; | 2521 | goto fi0; |
2522 | } | 2522 | } |
2523 | if (p < text || p > end) { | 2523 | if (p < text || p > end) { |
@@ -2528,19 +2528,19 @@ static int file_insert(const char *fn, char *p, int update_ro_status) | |||
2528 | // read file to buffer | 2528 | // read file to buffer |
2529 | fd = open(fn, O_RDONLY); | 2529 | fd = open(fn, O_RDONLY); |
2530 | if (fd < 0) { | 2530 | if (fd < 0) { |
2531 | status_line_bold("\"%s\" %s", fn, strerror(errno)); | 2531 | status_line_bold("'%s' %s", fn, strerror(errno)); |
2532 | goto fi0; | 2532 | goto fi0; |
2533 | } | 2533 | } |
2534 | size = statbuf.st_size; | 2534 | size = (statbuf.st_size < INT_MAX ? (int)statbuf.st_size : INT_MAX); |
2535 | p += text_hole_make(p, size); | 2535 | p += text_hole_make(p, size); |
2536 | cnt = safe_read(fd, p, size); | 2536 | cnt = safe_read(fd, p, size); |
2537 | if (cnt < 0) { | 2537 | if (cnt < 0) { |
2538 | status_line_bold("\"%s\" %s", fn, strerror(errno)); | 2538 | status_line_bold("'%s' %s", fn, strerror(errno)); |
2539 | p = text_hole_delete(p, p + size - 1); // un-do buffer insert | 2539 | p = text_hole_delete(p, p + size - 1); // un-do buffer insert |
2540 | } else if (cnt < size) { | 2540 | } else if (cnt < size) { |
2541 | // There was a partial read, shrink unused space text[] | 2541 | // There was a partial read, shrink unused space text[] |
2542 | p = text_hole_delete(p + cnt, p + (size - cnt) - 1); // un-do buffer insert | 2542 | p = text_hole_delete(p + cnt, p + (size - cnt) - 1); // un-do buffer insert |
2543 | status_line_bold("can't read all of file \"%s\"", fn); | 2543 | status_line_bold("can't read '%s'", fn); |
2544 | } | 2544 | } |
2545 | if (cnt >= size) | 2545 | if (cnt >= size) |
2546 | file_modified++; | 2546 | file_modified++; |
@@ -3478,7 +3478,7 @@ static void do_cmd(int c) | |||
3478 | } else { | 3478 | } else { |
3479 | file_modified = 0; | 3479 | file_modified = 0; |
3480 | last_file_modified = -1; | 3480 | last_file_modified = -1; |
3481 | status_line("\"%s\" %dL, %dC", current_filename, count_lines(text, end - 1), cnt); | 3481 | status_line("'%s' %dL, %dC", current_filename, count_lines(text, end - 1), cnt); |
3482 | if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n' | 3482 | if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n' |
3483 | || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N' | 3483 | || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N' |
3484 | ) { | 3484 | ) { |
@@ -3676,7 +3676,7 @@ static void do_cmd(int c) | |||
3676 | } | 3676 | } |
3677 | if (file_modified) { | 3677 | if (file_modified) { |
3678 | if (ENABLE_FEATURE_VI_READONLY && readonly_mode) { | 3678 | if (ENABLE_FEATURE_VI_READONLY && readonly_mode) { |
3679 | status_line_bold("\"%s\" File is read only", current_filename); | 3679 | status_line_bold("'%s' is read only", current_filename); |
3680 | break; | 3680 | break; |
3681 | } | 3681 | } |
3682 | cnt = file_write(current_filename, text, end - 1); | 3682 | cnt = file_write(current_filename, text, end - 1); |