]> git.notmuchmail.org Git - notmuch/blobdiff - util/string-util.c
crypto: add --decrypt=nostash to avoid stashing session keys
[notmuch] / util / string-util.c
index 18125309ebe9ed33c048f928e02d1e6b35edca28..b0108811903b27153dcaece1fa10b893234c3b9f 100644 (file)
@@ -255,3 +255,16 @@ strcase_hash (const void *ptr)
 
     return hash;
 }
+
+void
+strip_trailing (char *str, char ch)
+{
+    int i;
+
+    for (i = strlen (str) - 1; i >= 0; i--) {
+       if (str[i] == ch)
+           str[i] = '\0';
+       else
+           break;
+    }
+}