]> diplodocus.org Git - nmh/blobdiff - sbr/utils.c
Removed a couple of unnecessary vector typedefs from h/mh.h.
[nmh] / sbr / utils.c
index d8b060fb13ce5f7a87a949166fe01e6d566c73d6..59ab7c72754bf6c0bcd3bb85e2393ae22de5d517 100644 (file)
@@ -352,3 +352,16 @@ nmh_init(const char *argv0, int read_context) {
         return status;
     }
 }
+
+
+/* Returns copy of argument str with all characters converted to upper
+   case, and trimmed whitespace (see cpytrim()) . */
+char *
+upcase (const char *str) {
+    char *up = cpytrim (str);
+    char *cp;
+
+    for (cp = up; *cp; ++cp) { *cp = toupper ((unsigned char) *cp); }
+
+    return up;
+}