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

[PATCH] tools: escape double quotes in company names

flat view
STALE3685d

From: Mike Ryan <hidden>
Date: 2016-08-10 14:52:57
Subsystem: the rest · Maintainer: Linus Torvalds

Double quotes in company names are properly escaped so that they are
valid C string literals.
---
 tools/parse_companies.pl | 1 +
 1 file changed, 1 insertion(+)
diff --git a/tools/parse_companies.pl b/tools/parse_companies.pl
index f755390..99d3f31 100755
--- a/tools/parse_companies.pl
+++ b/tools/parse_companies.pl
@@ -51,6 +51,7 @@ while (<>) {
         my $name = uri_decode($1);
         $name =~ s/^\s+//g; # kill leading
         $name =~ s/\s+$//g; # and trailing space
+        $name =~ s/"/\\"/g; # escape double quotes
         my $id = hex($identifier);
         if ($id != 65535) {
             print "\tcase $id:\n";
-- 
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