Even if the content is not parsable, we still accept it as a From_
line delimiter.
If no path or tp is passed in, skip the reverse scan.
---
from.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/from.c b/from.c
index 0f523dcd..0fb3f765 100644
--- a/from.c
+++ b/from.c
@@ -310,17 +310,15 @@ int is_from (const char *s, char *path, size_t pathlen,
time_t *tp)
if (!*s)
return 0;
+ if (!(path || tp))
+ return 1;
+
dprint (3, (debugfile, "\nis_from(): parsing: %s", s));
-
- if (!is_from_reverse_scan (s, path, pathlen, &tm))
- return 0;
-
- dprint (3, (debugfile,
- "is_from(): month=%d, day=%d, hr=%d, min=%d, sec=%d, yr=%d.\n",
- tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec,
tm.tm_year));
-
- if (tp)
+ if (is_from_reverse_scan (s, path, pathlen, &tm) && tp)
{
+ dprint (3, (debugfile,
+ "is_from(): month=%d, day=%d, hr=%d, min=%d, sec=%d, yr=%d.\n",
+ tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec,
tm.tm_year));
tm.tm_isdst = -1;
*tp = mutt_mktime (&tm, 0);
}
--
2.52.0