Skip to content

Instantly share code, notes, and snippets.

@findchris
Created April 11, 2012 21:03
Show Gist options
  • Select an option

  • Save findchris/2362565 to your computer and use it in GitHub Desktop.

Select an option

Save findchris/2362565 to your computer and use it in GitHub Desktop.
Patch to add region name to geoiplookup
\diff --git a/apps/geoiplookup.c b/apps/geoiplookup.c
index bd3c6fc..44a6d8e 100644
--- a/apps/geoiplookup.c
+++ b/apps/geoiplookup.c
@@ -296,7 +296,8 @@ geoiplookup(GeoIP * gi, char *hostname, int i)
printf("%s: IP Address not found\n", GeoIPDBDescription[i]);
}
else {
- printf("%s: %s, %s, %s, %s, %f, %f\n", GeoIPDBDescription[i], gir->country_code, _mk_NA(gir->region),
+ printf("%s: %s, %s, %s, %s, %s, %f, %f\n", GeoIPDBDescription[i], gir->country_code, _mk_NA(gir->region),
+ _mk_NA(GeoIP_region_name_by_code(gir->country_code, gir->region)),
_mk_NA(gir->city), _mk_NA(gir->postal_code), gir->latitude, gir->longitude);
_say_range_by_ip(gi, ipnum);
GeoIPRecord_delete(gir);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment