From: Ralph Corderoy Date: Sat, 10 Dec 2016 14:43:59 +0000 (+0000) Subject: Rename recently added TrimSuffixC() to trim_suffix_c(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/8c69934299322c189e72259c2b31545c94697ea8 Rename recently added TrimSuffixC() to trim_suffix_c(). --- diff --git a/h/utils.h b/h/utils.h index 767ff9b8..7dc407d6 100644 --- a/h/utils.h +++ b/h/utils.h @@ -70,7 +70,7 @@ void trunccpy(char *dst, const char *src, size_t size); bool has_prefix(const char *s, const char *prefix); bool has_suffix(const char *s, const char *suffix); bool has_suffix_c(const char *s, int c); -void TrimSuffixC(char *s, int c); +void trim_suffix_c(char *s, int c); void ToLower(char *s); void ToUpper(char *s); diff --git a/sbr/read_line.c b/sbr/read_line.c index 51fa87d9..c9167ab5 100644 --- a/sbr/read_line.c +++ b/sbr/read_line.c @@ -9,7 +9,7 @@ read_line(void) fflush(stdout); if (fgets(line, sizeof(line), stdin) == NULL) return NULL; - TrimSuffixC(line, '\n'); + trim_suffix_c(line, '\n'); return line; /* May not be a complete line. */ } diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 1d946fa2..9784e89e 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -150,7 +150,7 @@ ruserpass(const char *host, char **aname, char **apass, int flags) if (fgets(tmp, sizeof tmp, stdin) == NULL) { advise ("tmp", "fgets"); } - TrimSuffixC(tmp, '\n'); + trim_suffix_c(tmp, '\n'); if (*tmp != '\0' || myname == NULL) { myname = tmp; } diff --git a/sbr/utils.c b/sbr/utils.c index c620d62e..93ddc500 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -403,9 +403,9 @@ bool has_suffix_c(const char *s, int c) } -/* TrimSuffixC deletes c from the end of non-NULL string s if it's +/* trim_suffix_c deletes c from the end of non-NULL string s if it's * present, shortening s by 1. Only one instance of c is removed. */ -void TrimSuffixC(char *s, int c) +void trim_suffix_c(char *s, int c) { if (!*s) return; diff --git a/uip/mhlogin.c b/uip/mhlogin.c index ffa44f3f..4a42aea2 100644 --- a/uip/mhlogin.c +++ b/uip/mhlogin.c @@ -40,7 +40,7 @@ geta (void) if (fgets(line, sizeof(line), stdin) == NULL) done (1); - TrimSuffixC(line, '\n'); + trim_suffix_c(line, '\n'); return line; } diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index d3450494..99149d9e 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -585,7 +585,7 @@ mhl_format (char *file, int length, int width) if (*bp == ';') continue; - TrimSuffixC(bp, '\n'); + trim_suffix_c(bp, '\n'); if (*bp == ':') { (void) add_queue (&fmthd, &fmttl, NULL, bp + 1, CLEARTEXT); diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 5a6f630c..c9725ffd 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -1298,7 +1298,7 @@ clobber_check (char *original_file, mhstoreinfo_t info) { file = NULL; ++info->files_not_clobbered; } else { - TrimSuffixC(buf, '\n'); + trim_suffix_c(buf, '\n'); } free (file); diff --git a/uip/post.c b/uip/post.c index e62473e7..385aae20 100644 --- a/uip/post.c +++ b/uip/post.c @@ -825,7 +825,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) should never have reached this point. Warn about any that are non-empty. */ if (strcmp (str, "\n")) { - TrimSuffixC(str, '\n'); + trim_suffix_c(str, '\n'); if (! whomsw) { advise (NULL, "ignoring header line -- %s: %s", name, str); } diff --git a/uip/slocal.c b/uip/slocal.c index 4c670b98..0e3baae4 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -452,7 +452,7 @@ usr_delivery (int fd, char *delivery, int su) if (*buffer == '#' || *buffer == '\n') continue; - TrimSuffixC(buffer, '\n'); + trim_suffix_c(buffer, '\n'); /* split buffer into fields */ vecp = split (buffer, vec); diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 833c2f58..919dd901 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -328,7 +328,7 @@ WhatNow (int argc, char **argv) if (fgets(cwd, sizeof (cwd), f) == NULL) { advise (buf, "fgets"); } - TrimSuffixC(cwd, '\n'); + trim_suffix_c(cwd, '\n'); pclose(f); } else { @@ -435,7 +435,7 @@ WhatNow (int argc, char **argv) while (fgets(shell, sizeof (shell), f) != NULL) { char *ctype; - TrimSuffixC(shell, '\n'); + trim_suffix_c(shell, '\n'); if (*shell == '/') { strncpy(file, shell, sizeof(file)); @@ -520,7 +520,7 @@ WhatNow (int argc, char **argv) writelscmd(buf, sizeof(buf), "-d --", argp); if ((f = popen_in_dir(cwd, buf, "r")) != NULL) { while (fgets(shell, sizeof (shell), f) != NULL) { - TrimSuffixC(shell, '\n'); + trim_suffix_c(shell, '\n'); annotate(drft, ATTACH_FIELD, shell, 1, 0, 0, 1); } pclose(f);