]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Treat an empty string the same way as a NULL country argument.
authorRussell Bryant <russell@russellbryant.com>
Wed, 7 Jan 2009 17:29:53 +0000 (17:29 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 7 Jan 2009 17:29:53 +0000 (17:29 +0000)
In passing, simplify the handling of returning a default tone zone.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167432 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/indications.c

index 555e80161fc8afc504399fe94b293f54ea4faf5e..f9d9a85fab57ffa38b1c3d70e686b058f01e6dd3 100644 (file)
@@ -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 {