summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
122129d)
TrimSuffixC 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.
char *rfind_str (const char [], size_t, const char *);
char *nmh_strcasestr (const char *, const char *);
char *rfind_str (const char [], size_t, const char *);
char *nmh_strcasestr (const char *, const char *);
+void TrimSuffixC(char *s, int c);
+
/*
* See if a string contains 8 bit characters (use isascii() for the test).
* Arguments include:
/*
* See if a string contains 8 bit characters (use isascii() for the test).
* Arguments include:
+/* TrimSuffixC 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)
+{
+ if (!*s)
+ return;
+
+ s += strlen(s) - 1;
+ if (*s == c)
+ *s = '\0';
+}
+
+
int
nmh_init(const char *argv0, int read_context) {
if (! setlocale(LC_ALL, "")) {
int
nmh_init(const char *argv0, int read_context) {
if (! setlocale(LC_ALL, "")) {