calendar apparently always considers // as the start of a comment. This is annoying if one wishes to put an URL in a calendar entry. This used to be possible until a few months ago in 12-STABLE Could you consider restricting this behaviour to cases where it is at the beginning of a line or preceded by a white-space character ?
I have added the C++ style comments to calendar as part of the changes that brought back features lost when a very restricted internal pre-processor had been implemented to replace piping of calendar files through an external C pre-processor. It is of course possible to ignore // if it is used as part of a URL (i.e. if it follows a colon) or if it is preceded by any non-whitespace character. I'll prepare a patch for review on phabricator and attach it to this PR.
Created attachment 225624 [details] Ignore // within words to allow URLs in calendar entries The parsing of // has been changed to only start a comment at begin of line or after white-space.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=35b8fd0b699a20f71d5636069347b243eb336979 commit 35b8fd0b699a20f71d5636069347b243eb336979 Author: Stefan EÃer <se@FreeBSD.org> AuthorDate: 2021-06-07 13:46:24 +0000 Commit: Stefan EÃer <se@FreeBSD.org> CommitDate: 2021-06-07 13:55:23 +0000 usr.bin/calendar: do not treat // in text as comment The C++-style comment marker "//" has been added with the rewrite of the preprocessor features. Since this character sequence occurs in ULRS, the reminder of the URL was considered a comment and stripped from the calendar line. Change parsing of "//" to only start a comment at the begin of a line or when preceeded by a white-space character. PR: 256455 Reported by: Philippe Michel (philippe.michel7 at free.fr) MFC after: 3 days usr.bin/calendar/io.c | 22 ++++++++++++++-------- usr.bin/calendar/tests/calendar.comment | 3 ++- usr.bin/calendar/tests/regress.comment.out | 2 ++ 3 files changed, 18 insertions(+), 9 deletions(-)