fclose -> m_fclose
[apps/madmutt.git] / lib-mime / mime-token.sh
index 17ed4c1..229394c 100644 (file)
@@ -39,7 +39,7 @@ do_h() {
 
 enum mime_token {
     MUTT_MIME_TOKEN_UNKNOWN,
 
 enum mime_token {
     MUTT_MIME_TOKEN_UNKNOWN,
-`tr 'a-z-' 'A-Z_' | sed -e 's/.*/    MIME_&,/'`
+`tr 'a-z-/' 'A-Z__' | sed -e 's/.*/    MIME_&,/'`
 };
 
 __attribute__((pure))
 };
 
 __attribute__((pure))
@@ -53,25 +53,29 @@ do_c() {
 %{
 `do_hdr`
 
 %{
 `do_hdr`
 
-#include <lib-lib/str.h>
+#include <lib-lib/lib-lib.h>
 #include "mime-token.h"
 
 #include "mime-token.h"
 
+static const struct tok *
+mime_which_token_aux(const char *str, unsigned int len);
+
 %}
 struct tok { const char *name; int val; };
 %%
 `awk '{print $0 ", " NR }'`
 %%
 
 %}
 struct tok { const char *name; int val; };
 %%
 `awk '{print $0 ", " NR }'`
 %%
 
-enum mime_token mime_which_token(const char *s, ssize_t len) {
-    const struct tok *res;
-
+enum mime_token mime_which_token(const char *s, ssize_t len)
+{
     if (len < 0)
         len = m_strlen(s);
     if (len < 0)
         len = m_strlen(s);
-    if (!len)
-        return MUTT_MIME_TOKEN_UNKNOWN;
 
 
-    res = mime_which_token_aux(s, len);
-    return res ? res->val : MUTT_MIME_TOKEN_UNKNOWN;
+    if (len) {
+        const struct tok *res = mime_which_token_aux(s, len);
+        return res ? res->val : MUTT_MIME_TOKEN_UNKNOWN;
+    } else {
+        return MUTT_MIME_TOKEN_UNKNOWN;
+    }
 }
 EOF
 }
 }
 EOF
 }