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);
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. */
}
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;
}
}
-/* 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;
if (fgets(line, sizeof(line), stdin) == NULL)
done (1);
- TrimSuffixC(line, '\n');
+ trim_suffix_c(line, '\n');
return line;
}
if (*bp == ';')
continue;
- TrimSuffixC(bp, '\n');
+ trim_suffix_c(bp, '\n');
if (*bp == ':') {
(void) add_queue (&fmthd, &fmttl, NULL, bp + 1, CLEARTEXT);
file = NULL;
++info->files_not_clobbered;
} else {
- TrimSuffixC(buf, '\n');
+ trim_suffix_c(buf, '\n');
}
free (file);
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 (*buffer == '#' || *buffer == '\n')
continue;
- TrimSuffixC(buffer, '\n');
+ trim_suffix_c(buffer, '\n');
/* split buffer into fields */
vecp = split (buffer, vec);
if (fgets(cwd, sizeof (cwd), f) == NULL) {
advise (buf, "fgets");
}
- TrimSuffixC(cwd, '\n');
+ trim_suffix_c(cwd, '\n');
pclose(f);
}
else {
while (fgets(shell, sizeof (shell), f) != NULL) {
char *ctype;
- TrimSuffixC(shell, '\n');
+ trim_suffix_c(shell, '\n');
if (*shell == '/') {
strncpy(file, shell, sizeof(file));
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);