summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-18 15:00:25 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-18 15:00:25 -0200
commit9e4ef3cfe5ee178c266edd64a8edd767827aa0d7 (patch)
tree120a7fe49c60a8d4f69f6fd1d1c2da3bd55c4df1 /hw
parent3d3c234b434a3443a00c3be9f32c698bcced111c (diff)
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.
Diffstat (limited to 'hw')
-rwxr-xr-xhw/xfree86/loader/sdksyms.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
index 41a68fbaf..e6c15cca4 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);