Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 488a54f

Browse files
committed
Rename custom_directory to GeoIP_custom_directory.
1 parent e16c20d commit 488a54f

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Rename custom_directory to GeoIP_custom_directory. ( Boris Zentner )
12
* Make sure the database match the requested type. This is helpful for
23
Databases with the same default name and the general geoiplookup form
34
( geoiplookup without a specific database ) ( Boris Zentner )

libGeoIP/GeoIP.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,17 +363,17 @@ const char * GeoIPDBDescription[NUM_DB_TYPES] = {
363363
"GeoIP Accuracy Radius Edition V6"
364364
};
365365

366-
static char * custom_directory = NULL;
366+
char * GeoIP_custom_directory = NULL;
367367

368368
void GeoIP_setup_custom_directory (char * dir) {
369-
custom_directory = dir;
369+
GeoIP_custom_directory = dir;
370370
}
371371

372372
char *_GeoIP_full_path_to(const char *file_name) {
373373
int len;
374374
char *path = malloc(sizeof(char) * 1024);
375375

376-
if (custom_directory == NULL){
376+
if (GeoIP_custom_directory == NULL){
377377
#if !defined(_WIN32)
378378
memset(path, 0, sizeof(char) * 1024);
379379
snprintf(path, sizeof(char) * 1024 - 1, "%s/%s", GEOIPDATADIR, file_name);
@@ -394,11 +394,11 @@ char *_GeoIP_full_path_to(const char *file_name) {
394394
snprintf(path, sizeof(char) * 1024 - 1, "%s/%s", buf, file_name);
395395
#endif
396396
} else {
397-
len = strlen(custom_directory);
398-
if (custom_directory[len-1] != '/') {
399-
snprintf(path, sizeof(char) * 1024 - 1, "%s/%s",custom_directory, file_name);
397+
len = strlen(GeoIP_custom_directory);
398+
if (GeoIP_custom_directory[len-1] != '/') {
399+
snprintf(path, sizeof(char) * 1024 - 1, "%s/%s", GeoIP_custom_directory, file_name);
400400
} else {
401-
snprintf(path, sizeof(char) * 1024 - 1, "%s%s", custom_directory, file_name);
401+
snprintf(path, sizeof(char) * 1024 - 1, "%s%s", GeoIP_custom_directory, file_name);
402402
}
403403
}
404404
return path;

libGeoIP/GeoIP.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ extern const char *GeoIPISPDBFileName;
164164
extern const char *GeoIPLocationADBFileName;
165165
extern const char *GeoIPAccuracyRadiusFileName;
166166
extern const char *GeoIPCityConfidenceFileName;
167+
extern char * GeoIP_custom_directory;
167168

168169
/* Warning: do not use those arrays as doing so may break your
169170
* program with newer GeoIP versions */

0 commit comments

Comments
 (0)