From: David Levine Date: Sun, 20 Sep 2020 15:20:36 +0000 (-0400) Subject: Fixed mhical(1) exit status to reflect return status of icalparse(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/085bca07c0b505f095a50666a3752e5fcb69bc70?hp=843bc850b2b7732c8969b9ad25e922fb09eaf4b3 Fixed mhical(1) exit status to reflect return status of icalparse(). Also, removed parser_status as a global: just use the return status of icalparse(). And had to change test-mhical to reflect new exit status from mhical with empty input. Thanks to Ralph for pointing out that test-mhical previously had an unnecessary test of the mhical exit status. --- diff --git a/h/icalendar.h b/h/icalendar.h index 1f76921e..917339e7 100644 --- a/h/icalendar.h +++ b/h/icalendar.h @@ -88,7 +88,6 @@ extern int icaldebug; int icalparse (void); extern vevent vevents; int icallex (void); -extern int parser_status; /* And this is for the icalendar scanner. */ extern YYSTYPE icallval; diff --git a/sbr/icalparse.y b/sbr/icalparse.y index 0213fa90..bc051392 100644 --- a/sbr/icalparse.y +++ b/sbr/icalparse.y @@ -355,8 +355,7 @@ icalerror (const char *error) } else { inform ("%s", error); } - parser_status = -1; - return -1; + return 1; } return 0; /* The return value isn't used anyway. */ diff --git a/test/mhical/test-mhical b/test/mhical/test-mhical index 76813520..7b75789a 100755 --- a/test/mhical/test-mhical +++ b/test/mhical/test-mhical @@ -950,7 +950,7 @@ start_test "invalid line folding" cat >"$expected" <<'EOF' Summary: test -Description: this file does not end with a newline +Description: test of invalid line folding At: Sun, 14 May 2017 13:00 +0000 To: Sun, 14 May 2017 14:00 EOF @@ -969,8 +969,8 @@ DTSTAMP:20170514T122300Z DTSTART:20170514T130000Z DTEND:20170514T140000Z SUMMARY:test -DESCRIPTION:this file does not end with a newline -and this line is not folded, +DESCRIPTION:test of invalid line folding +where this line is not folded, END:VEVENT END:VCALENDAR" | TZ=UTC mhical >"$actual" 2>"$actual_err" set -e @@ -980,7 +980,7 @@ check "$expected_err" "$actual_err" # check null input start_test "null input" -check_exit '-eq 0' mhical contentlines &&