aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-07 17:29:53 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-07 17:29:53 +0000
commita41ad4dbd81bdad88f18b154281219542ac2b2c0 (patch)
treed66c6334ec37a27d84256267e070a371cb4d06a7
parent7a2ed6afd343b51c1934fad28c0292fd252ce77f (diff)
Treat an empty string the same way as a NULL country argument.
In passing, simplify the handling of returning a default tone zone. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167432 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/indications.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/main/indications.c b/main/indications.c
index 555e80161..f9d9a85fa 100644
--- a/main/indications.c
+++ b/main/indications.c
@@ -373,13 +373,10 @@ struct ind_tone_zone *ast_get_indication_zone(const char *country)
struct ind_tone_zone *tz;
int alias_loop = 0;
- /* we need some tonezone, pick the first */
- if (country == NULL && current_tonezone)
- return current_tonezone; /* default country? */
- if (country == NULL && ind_tone_zones)
- return ind_tone_zones; /* any country? */
- if (country == NULL)
- return 0; /* not a single country insight */
+ if (ast_strlen_zero(country)) {
+ /* No country specified? Return the default or the first in the list */
+ return current_tonezone ? current_tonezone : ind_tone_zones;
+ }
ast_mutex_lock(&tzlock);
do {