xserver: Branch 'master'

Paulo Cesar Pereira de Andrade pcpa at kemper.freedesktop.org
Thu Dec 18 09:28:09 PST 2008


 hw/xfree86/loader/sdksyms.sh |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 9e4ef3cfe5ee178c266edd64a8edd767827aa0d7
Author: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
Date:   Thu Dec 18 15:00:25 2008 -0200

    Use regex pattern understood by all known awk variants.
    
      Ubuntu uses mawk by default, but it doesn't understand posix character
    classes (which are locale dependent, and this patch uses only valid C
    identifiers).
      Also make sure awk runs with LC_ALL=C to match the regex patterns.

diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
index 41a68fb..e6c15cc 100755
--- a/hw/xfree86/loader/sdksyms.sh
+++ b/hw/xfree86/loader/sdksyms.sh
@@ -321,6 +321,8 @@ EOF
 
 topdir=$1
 shift
+LC_ALL=C
+export LC_ALL
 cpp -DXorgLoader $@ sdksyms.c | awk -v topdir=$topdir '
 BEGIN {
     sdk = 0;
@@ -339,7 +341,7 @@ BEGIN {
     sdk = $3 !~ /^"\// || index($3, topdir) == 2;
 }
 
-/^extern[[:space:]]/  {
+/^extern[ 	]/  {
     if (sdk) {
 	n = 3;
 
@@ -353,17 +355,17 @@ BEGIN {
 
 	# type specifier may not be set, as in
 	#   extern _X_EXPORT unsigned name(...)
-	if ($n !~ /[^[:alnum:]_]/)
+	if ($n !~ /[^a-zA-Z0-9_]/)
 	    n++;
 
 	# match
 	#    extern _X_EXPORT type (* name[])(...)
-	if ($n ~ /^[^[:alnum:]_]+$/)
+	if ($n ~ /^[^a-zA-Z0-9_]+$/)
 	    n++;
 
 	# match
 	#	extern _X_EXPORT const name *const ...
-	if ($n ~ /^([^[:alnum:]_]+)?const$/)
+	if ($n ~ /^([^a-zA-Z0-9_]+)?const$/)
 	    n++;
 
 	# actual name may be in the next line, as in
@@ -379,10 +381,10 @@ BEGIN {
 	symbol = $n;
 
 	# remove starting non word chars
-	sub(/^[^[:alnum:]_]+/, "",symbol);
+	sub(/^[^a-zA-Z0-9_]+/, "",symbol);
 
 	# remove from first non word to end of line
-	sub(/[^[:alnum:]_].*/, "", symbol);
+	sub(/[^a-zA-Z0-9_].*/, "", symbol);
 
 	#print;
 	printf("    &%s,\n", symbol);


More information about the xorg-commit mailing list