From 70c80ac22ec551c1c6e4f8f6f8b423c674294969 Mon Sep 17 00:00:00 2001 From: Tony Lawrence Date: Sat, 22 Oct 2022 20:02:16 -0400 Subject: [PATCH 1/2] Mention autoconf.sh in build instructions (#61) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6438e67..e041a1f 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ current maintainer works exclusively on GNU/Linux systems, so it may use GCC and GNU Make specific extensions here and there. This is not on purpose and patches or pull requests to correct this are most welcome! +0. Call ./automake.sh if you build from git 1. Configure editline with default features: ./configure 2. Build the library and examples: make all 3. Install using make install From c50d4c34d80a051ccb381301324cd3472902b363 Mon Sep 17 00:00:00 2001 From: Tony Lawrence Date: Sat, 22 Oct 2022 20:02:23 -0400 Subject: [PATCH 2/2] Avoid using (char) in macros (#61) --- src/complete.c | 4 ++-- src/editline.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/complete.c b/src/complete.c index d78406e..c443270 100644 --- a/src/complete.c +++ b/src/complete.c @@ -278,7 +278,7 @@ static char *rl_find_token(size_t *len) int pos; for (pos = rl_point; pos < rl_end; pos++) { - if (isspace(rl_line_buffer[pos])) { + if (isspace((unsigned char) rl_line_buffer[pos])) { if (pos > 0) pos--; break; @@ -286,7 +286,7 @@ static char *rl_find_token(size_t *len) } ptr = &rl_line_buffer[pos]; - while (pos >= 0 && !isspace(rl_line_buffer[pos])) { + while (pos >= 0 && !isspace((unsigned char) rl_line_buffer[pos])) { if (pos == 0) break; diff --git a/src/editline.c b/src/editline.c index 190dd0b..2ed8086 100644 --- a/src/editline.c +++ b/src/editline.c @@ -494,10 +494,10 @@ static el_status_t do_case(el_case_t type) for (i = rl_point, p = &rl_line_buffer[i]; rl_point < end; p++) { if ((type == TOupper) || (type == TOcapitalize && rl_point == i)) { - if (islower(*p)) - *p = toupper(*p); - } else if (isupper(*p)) { - *p = tolower(*p); + if (islower((unsigned char)(*p))) + *p = toupper((unsigned char)(*p)); + } else if (isupper((unsigned char)(*p))) { + *p = tolower((unsigned char)(*p)); } right(CSmove); } @@ -1875,14 +1875,14 @@ static int argify(char *line, char ***avp) if (!p) return 0; - for (c = line; isspace(*c); c++) + for (c = line; isspace((unsigned char)(*c)); c++) continue; if (*c == '\n' || *c == '\0') return 0; for (ac = 0, p[ac++] = c; *c && *c != '\n'; ) { - if (!isspace(*c)) { + if (!isspace((unsigned char)(*c))) { c++; continue; }