From: Eric S. Raymond Date: Sat, 8 Nov 2014 16:02:25 +0000 (-0500) Subject: Detect malformed comments rather than byte-stuffing. X-Git-Tag: 0.2~19 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=fbfaae3a23e1d06653ded5a9b20f8f18612ed95c;p=src.git Detect malformed comments rather than byte-stuffing. --- diff --git a/src b/src index f529d5c..c56df66 100755 --- a/src +++ b/src @@ -445,7 +445,8 @@ def commit_method(*args): commentfile = "/tmp/src%dtmp" % os.getpid() do_or_die(editor + " " + commentfile, loud=True) comment = open(commentfile).read() - if metadata.delimiter in comment: + # Delimiter won't be set just after add + if metadata.delimiter and metadata.delimiter in comment: croak("malformed comment") if not comment.endswith("\n"): comment += "\n"