From 7bf210a9eff8f54d1fb0d9f7f466a77a88bd6b1d Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 18 Mar 2008 23:56:32 -0400 Subject: properly handle lines like $"foo is \"wow\", is it not?" --- po/xgettext_sh.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/po/xgettext_sh.py b/po/xgettext_sh.py index 137de46f..ac18593e 100644 --- a/po/xgettext_sh.py +++ b/po/xgettext_sh.py @@ -42,7 +42,19 @@ def xgettext(arq): else: for match in pattern.finditer(l): pos = match.start() - text = split(l[pos:], '"')[1] + p1 = l.find('"',pos) + 1 + p2 = p1+1 + while 1: + p2 = l.find('"',p2) + if p2 == -1: + p2 = p1 + break + if l[p2-1] == '\\': + p2 = p2 + 1 + else: + break + text = l[p1:p2] + #text = split(l[pos:], '"')[1] if s.has_key(text): s[text].append((arq, line)) else: -- cgit v1.2.1