]> diplodocus.org Git - nmh/blobdiff - sbr/utils.c
Remove mhbuild backup files at end of a couple of tests, if successful.
[nmh] / sbr / utils.c
index d17bad94b6c5926f4b322582f60d87def3eb3970..59ab7c72754bf6c0bcd3bb85e2393ae22de5d517 100644 (file)
@@ -328,9 +328,7 @@ nmh_strcasestr (const char *s1, const char *s2) {
 
 int
 nmh_init(const char *argv0, int read_context) {
-#ifdef LOCALE
     setlocale(LC_ALL, "");
-#endif
 
     invo_name = r1bindex ((char *) argv0, '/');
 
@@ -354,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;
+}