]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_scan.c
Add more functionality to fmttest; it's starting to get semi-useful.
[nmh] / sbr / fmt_scan.c
index 0d9e1e9..879f771 100644 (file)
 #  include <wchar.h>
 #endif
 
-#ifdef LBL
-struct msgs *fmt_current_folder; /* current folder (set by main program) */
-#endif
-
 extern int fmt_norm;           /* defined in sbr/fmt_def.c = AD_NAME */
 struct mailname fmt_mnull = { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0,
                              NULL, NULL };
@@ -371,11 +367,11 @@ fmt_scan (struct format *format, char *scanl, size_t max, int width, int *dat)
 
            comp = fmt->f_comp;
 
-           if (! (comp->c_flags & CF_TRIMMED) && comp->c_text) {
-               i = strlen(comp->c_text);
+           if (! (comp->c_flags & CF_TRIMMED) && comp->c_text &&
+               (i = strlen(comp->c_text)) > 0) {
                if (comp->c_text[i - 1] == '\n' &&
-                       strcmp(comp->c_name, "body") != 0 &&
-                       strcmp(comp->c_name, "text") != 0)
+                   strcmp(comp->c_name, "body") != 0 &&
+                   strcmp(comp->c_name, "text") != 0)
                    comp->c_text[i - 1] = '\0';
                comp->c_flags |= CF_TRIMMED;
            }
@@ -997,17 +993,6 @@ fmt_scan (struct format *format, char *scanl, size_t max, int width, int *dat)
                comp->c_mn = &fmt_mnull;
            }
            break;
-
-       case FT_ADDTOSEQ:
-#ifdef LBL
-           /* If we're working on a folder (as opposed to a file), add the
-            * current msg to sequence given in literal field.  Don't
-            * disturb string or value registers.
-            */
-           if (fmt_current_folder)
-                   seq_addmsg(fmt_current_folder, fmt->f_text, dat[0], -1);
-#endif
-           break;
        }
        fmt++;
     }