translate unicode quotes to ascii ones so we can keep our regex simple (trunk r5795...
authorZac Medico <zmedico@gentoo.org>
Sun, 28 Jan 2007 22:26:55 +0000 (22:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 28 Jan 2007 22:26:55 +0000 (22:26 -0000)
svn path=/main/branches/2.1.2/; revision=5823

bin/check-implicit-pointer-usage.py

index 4afa8f24bc35f429a9dc89f565791ff0b2319820..1648dc53d59c3c558dc3f63e9380bc6cdcbf66bf 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
 # Ripped from HP and updated from Debian
+# Update by Gentoo to support unicode output
 
 #
 # Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
@@ -16,7 +17,7 @@ import re
 import sys
 
 implicit_pattern = re.compile("([^:]*):(\d+): warning: implicit declaration "
-                              + "of function [`']([^']*)'")
+                              + "of function `([^']*)'")
 pointer_pattern = re.compile(
     "([^:]*):(\d+): warning: "
     + "("
@@ -36,6 +37,8 @@ while True:
     line = sys.stdin.readline()
     if line == '':
         break
+    # translate unicode open/close quotes to ascii ones
+    line = line.replace("\xE2\x80\x98", "`").replace("\xE2\x80\x99", "'")
     m = implicit_pattern.match(line)
     if m:
         last_implicit_filename = m.group(1)