summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <daniel@src.gnome.org>2006-11-27 18:22:22 +0000
committerDaniel Elstner <daniel@src.gnome.org>2006-11-27 18:22:22 +0000
commitc99a32eccd9e3101393d5521d40719202a08d3ca (patch)
treecca73f669a296fec40b088788c9f53f095795ac8
parent5d46bbc2971d73dcbf959adc16a3d9ae86a243a8 (diff)
downloadglibmm-c99a32eccd9e3101393d5521d40719202a08d3ca.tar.gz
Break the loop if the length of the common prefix reaches zero. This fixes
* tools/enum.pl (form_names): Break the loop if the length of the common prefix reaches zero. This fixes the infinite loop when processing the inconsistently named enumeration constants of the Hildon libraries.
-rw-r--r--ChangeLog7
-rw-r--r--tools/enum.pl5
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 25a6b1f6..1d848f83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-11-27 Daniel Elstner <danielk@openismus.com>
+
+ * tools/enum.pl (form_names): Break the loop if the length of the
+ common prefix reaches zero. This fixes the infinite loop when
+ processing the inconsistently named enumeration constants of the
+ Hildon libraries.
+
2006-11-22 Oliver Nittka <oly@nittka.com>
* glib/src/value_basictypes.cc.m4: When registering float parameters,
diff --git a/tools/enum.pl b/tools/enum.pl
index df41545d..dd35dc3c 100644
--- a/tools/enum.pl
+++ b/tools/enum.pl
@@ -4,6 +4,7 @@
# thus we must extract it ourselves.
# Usage: ./enum.pl /gnome/head/cvs/gconf/gconf/*.h > gconf_enums.defs
+use warnings;
my %token;
$module="none";
@@ -207,12 +208,14 @@ sub form_names
my $len=length($$c_name[0]) - 1;
my $j;
- for ($j=0;$j<$#c_name;$j++)
+
+ NAME: for ($j=0;$j<$#c_name;$j++)
{
while (substr($$c_name[$j],$len-1,1) ne "_" ||
substr($$c_name[$j],0,$len) ne substr($$c_name[$j+1],0,$len))
{
$len--;
+ last NAME if ($len <= 0);
}
#print substr($$c_name[$j],0,$len),"\n";
}