Thread (2 messages) 2 messages, 2 authors, 2016-09-15

[PATCH] tools: add more entities and better error handling to parse_companies

flat view
STALE3677d

From: Mike Ryan <hidden>
Date: 2016-08-11 20:19:45
Subsystem: the rest · Maintainer: Linus Torvalds

Add the remaining lowercase acute accented vowel HTML entities to
parse_companies.pl. On unknown entity, print an error to STDERR so the
maintainer can more clearly understand the failure.
---
 tools/parse_companies.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/parse_companies.pl b/tools/parse_companies.pl
index 99d3f31..d5b2815 100755
--- a/tools/parse_companies.pl
+++ b/tools/parse_companies.pl
@@ -8,7 +8,11 @@ use strict;
 
 my %known_entities = (
     'nbsp' => ' ',
+    'aacute' => 'á',
     'eacute' => 'é',
+    'iacute' => 'í',
+    'oacute' => 'ó',
+    'uacute' => 'ú',
     'auml' => 'ä',
     'uuml' => 'ü',
     'Uuml' => 'Ü',
@@ -23,8 +27,7 @@ sub uri_decode {
     }
     foreach my $entity (map { lc $_ } $name =~ /&([^;]+);/g) {
         if ($entity ne 'amp') {
-            print "Unable to convert &$entity;, giving up\n";
-            exit 1;
+            die "\nparse_companies.pl: Unable to convert &$entity; giving up\n";
         }
     }
     $name =~ s/&amp;/&/ig;
-- 
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help