X-Git-Url: https://git.bzium.org/embe/man-symlinker.git/blobdiff_plain/7e14ba25a59c3a2fed60595e383bea156627cd89..e21bd97439fa84c6d32f02c22935b961201a6b2b:/man-symlinker diff --git a/man-symlinker b/man-symlinker index aa90e38..cdca274 100755 --- a/man-symlinker +++ b/man-symlinker @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python # encoding: UTF-8 from __future__ import absolute_import, division @@ -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)