aboutsummaryrefslogtreecommitdiffstats
path: root/po/xgettext_sh.py
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-03-18 23:56:32 -0400
committerBill Nottingham <notting@redhat.com>2008-03-18 23:56:32 -0400
commit7bf210a9eff8f54d1fb0d9f7f466a77a88bd6b1d (patch)
tree0c4bc38c845a7b109c2bcc8cc89dcbc74c60ee8b /po/xgettext_sh.py
parent4822a7a38eb42fb77ef36c25c0eae1c85e0154ab (diff)
downloadinitscripts-7bf210a9eff8f54d1fb0d9f7f466a77a88bd6b1d.tar
initscripts-7bf210a9eff8f54d1fb0d9f7f466a77a88bd6b1d.tar.gz
initscripts-7bf210a9eff8f54d1fb0d9f7f466a77a88bd6b1d.tar.bz2
initscripts-7bf210a9eff8f54d1fb0d9f7f466a77a88bd6b1d.tar.xz
initscripts-7bf210a9eff8f54d1fb0d9f7f466a77a88bd6b1d.zip
properly handle lines like $"foo is \"wow\", is it not?"
Diffstat (limited to 'po/xgettext_sh.py')
-rw-r--r--po/xgettext_sh.py14
1 files changed, 13 insertions, 1 deletions
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: