summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanilo Segan <danilo@canonical.com>2011-07-06 10:55:29 +0200
committerDanilo Segan <danilo@canonical.com>2011-07-06 10:55:29 +0200
commit1206decbc678a85488a21baa60ef2084b49f72d2 (patch)
tree4e49766a4a01c607b249b60c89bb01949a491b3b
parent3007da8945d77d1d2b0f51f2809e59a190f87c6b (diff)
downloadintltool-1206decbc678a85488a21baa60ef2084b49f72d2.tar.gz
Improve detection of left-out files by fixing multi-line python strings handling and handling of multiple strings in a single line and inline # comments.
-rw-r--r--intltool-update.in11
1 files changed, 8 insertions, 3 deletions
diff --git a/intltool-update.in b/intltool-update.in
index c31dcd9..1ed6473 100644
--- a/intltool-update.in
+++ b/intltool-update.in
@@ -461,7 +461,7 @@ sub FindLeftoutFiles
# Handle continued multi-line string.
if ($in_string)
{
- next unless /(\'\'\'|\"\"\")/;
+ next unless s/.*(\'\'\'|\"\"\")//;
$in_string = 0;
}
@@ -477,7 +477,7 @@ sub FindLeftoutFiles
{
$in_macro = 1 if /^([^\\]|\\.)*\\$/;
next;
- }
+ }
# Handle comments and quoted text.
while (m-(/\*|//|\'\'\'|\"\"\"|\'|\")-) # \' and \" keep emacs perl mode happy
@@ -505,7 +505,12 @@ sub FindLeftoutFiles
}
else # ' or "
{
- if (!s-$match([^\\]|\\.)*?$match-QUOTEDTEXT-)
+ s-$match(\\$match|[^$match])*$match-QUOTEDTEXT-g;
+
+ # Handle inline # comments.
+ s/^([^$match]+)\#.*/$1/;
+
+ if (m-$match-)
{
warn "mismatched quotes at line $. in $file\n";
s-$match.*--;