From: Michał Bartoszkiewicz Date: Wed, 5 Oct 2011 19:33:30 +0000 (+0200) Subject: Obsługa komentarzy. X-Git-Tag: v1.0~2 X-Git-Url: https://git.bzium.org/embe/man-symlinker.git/commitdiff_plain/b8d64c601db22130659b92af1a69a30a73b3163e?ds=inline Obsługa komentarzy. --- diff --git a/man-symlinker b/man-symlinker index aa90e38..df13d06 100755 --- a/man-symlinker +++ b/man-symlinker @@ -22,10 +22,10 @@ def process_file(name): s = f.read(MAX_LEN+1) if len(s) > MAX_LEN: return False - s = s.strip() - if '\n' in s: - return False - m = SO_RE.search(s) + lines = [line for line in s.rstrip().split('\n') if not line.startswith('.\\"')] + if len(lines) != 1: + return False + m = SO_RE.search(lines[0]) if not m: return False link = m.group(1)