]> diplodocus.org Git - nmh/commitdiff
Rename recently added TrimSuffixC() to trim_suffix_c().
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 10 Dec 2016 14:43:59 +0000 (14:43 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 10 Dec 2016 14:43:59 +0000 (14:43 +0000)
h/utils.h
sbr/read_line.c
sbr/ruserpass.c
sbr/utils.c
uip/mhlogin.c
uip/mhlsbr.c
uip/mhstoresbr.c
uip/post.c
uip/slocal.c
uip/whatnowsbr.c

index 767ff9b..7dc407d 100644 (file)
--- 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);
 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);
 
 void ToLower(char *s);
 void ToUpper(char *s);
 
index 51fa87d..c9167ab 100644 (file)
@@ -9,7 +9,7 @@ read_line(void)
     fflush(stdout);
     if (fgets(line, sizeof(line), stdin) == NULL)
             return NULL;
     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. */
 }
 
     return line; /* May not be a complete line. */
 }
index 1d946fa..9784e89 100644 (file)
@@ -150,7 +150,7 @@ ruserpass(const char *host, char **aname, char **apass, int flags)
        if (fgets(tmp, sizeof tmp, stdin) == NULL) {
            advise ("tmp", "fgets");
        }
        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;
        }
        if (*tmp != '\0' || myname == NULL) {
            myname = tmp;
        }
index c620d62..93ddc50 100644 (file)
@@ -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. */
  * 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;
 {
     if (!*s)
         return;
index ffa44f3..4a42aea 100644 (file)
@@ -40,7 +40,7 @@ geta (void)
 
     if (fgets(line, sizeof(line), stdin) == NULL)
        done (1);
 
     if (fgets(line, sizeof(line), stdin) == NULL)
        done (1);
-    TrimSuffixC(line, '\n');
+    trim_suffix_c(line, '\n');
 
     return line;
 }
 
     return line;
 }
index d345049..99149d9 100644 (file)
@@ -585,7 +585,7 @@ mhl_format (char *file, int length, int width)
        if (*bp == ';')
            continue;
 
        if (*bp == ';')
            continue;
 
-        TrimSuffixC(bp, '\n');
+        trim_suffix_c(bp, '\n');
 
        if (*bp == ':') {
            (void) add_queue (&fmthd, &fmttl, NULL, bp + 1, CLEARTEXT);
 
        if (*bp == ':') {
            (void) add_queue (&fmthd, &fmttl, NULL, bp + 1, CLEARTEXT);
index 5a6f630..c9725ff 100644 (file)
@@ -1298,7 +1298,7 @@ clobber_check (char *original_file, mhstoreinfo_t info) {
                 file = NULL;
                 ++info->files_not_clobbered;
               } else {
                 file = NULL;
                 ++info->files_not_clobbered;
               } else {
-                TrimSuffixC(buf, '\n');
+                trim_suffix_c(buf, '\n');
               }
 
               free (file);
               }
 
               free (file);
index e62473e..385aae2 100644 (file)
@@ -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")) {
               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);
                }
                if (! whomsw) {
                    advise (NULL, "ignoring header line -- %s: %s", name, str);
                }
index 4c670b9..0e3baae 100644 (file)
@@ -452,7 +452,7 @@ usr_delivery (int fd, char *delivery, int su)
        if (*buffer == '#' || *buffer == '\n')
            continue;
 
        if (*buffer == '#' || *buffer == '\n')
            continue;
 
-        TrimSuffixC(buffer, '\n');
+        trim_suffix_c(buffer, '\n');
 
        /* split buffer into fields */
        vecp = split (buffer, vec);
 
        /* split buffer into fields */
        vecp = split (buffer, vec);
index 833c2f5..919dd90 100644 (file)
@@ -328,7 +328,7 @@ WhatNow (int argc, char **argv)
                if (fgets(cwd, sizeof (cwd), f) == NULL) {
                    advise (buf, "fgets");
                }
                if (fgets(cwd, sizeof (cwd), f) == NULL) {
                    advise (buf, "fgets");
                }
-                TrimSuffixC(cwd, '\n');
+                trim_suffix_c(cwd, '\n');
                pclose(f);
            }
            else {
                pclose(f);
            }
            else {
@@ -435,7 +435,7 @@ WhatNow (int argc, char **argv)
                while (fgets(shell, sizeof (shell), f) != NULL) {
                    char *ctype;
 
                while (fgets(shell, sizeof (shell), f) != NULL) {
                    char *ctype;
 
-                    TrimSuffixC(shell, '\n');
+                    trim_suffix_c(shell, '\n');
 
                    if (*shell == '/') {
                        strncpy(file, shell, sizeof(file));
 
                    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) {
            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);
                    annotate(drft, ATTACH_FIELD, shell, 1, 0, 0, 1);
                }
                pclose(f);