]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 71288 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Sun, 24 Jun 2007 17:39:34 +0000 (17:39 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sun, 24 Jun 2007 17:39:34 +0000 (17:39 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71288 | tilghman | 2007-06-24 12:32:21 -0500 (Sun, 24 Jun 2007) | 2 lines

Issue 10043 - There is a legitimate need to be able to set variables to the empty string.

........

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

main/db.c
main/manager.c

index b25cd3cf620caeb3d192bd58b7538aa1ebbd8ba1..f4eafc87fcd072a2f2816ffb11e5f8a2bc0ebe62 100644 (file)
--- a/main/db.c
+++ b/main/db.c
@@ -534,12 +534,8 @@ static int manager_dbput(struct mansession *s, const struct message *m)
                astman_send_error(s, m, "No key specified");
                return 0;
        }
-       if (ast_strlen_zero(val)) {
-               astman_send_error(s, m, "No val specified");
-               return 0;
-       }
 
-       res = ast_db_put(family, key, (char *) val);
+       res = ast_db_put(family, key, (char *) S_OR(val, ""));
        if (res) {
                astman_send_error(s, m, "Failed to update entry");
        } else {
index 2b6fbf796e3012fe4812ed9f3942fc20a0042494..be77dfc9414cf604abc1bb1b6f72e7ec0b821d87 100644 (file)
@@ -1372,11 +1372,6 @@ static int action_setvar(struct mansession *s, const struct message *m)
                return 0;
        }
        
-       if (ast_strlen_zero(varval)) {
-               astman_send_error(s, m, "No value specified");
-               return 0;
-       }
-
        if (!ast_strlen_zero(name)) {
                c = ast_get_channel_by_name_locked(name);
                if (!c) {
@@ -1385,7 +1380,7 @@ static int action_setvar(struct mansession *s, const struct message *m)
                }
        }
        
-       pbx_builtin_setvar_helper(c, varname, varval);
+       pbx_builtin_setvar_helper(c, varname, S_OR(varval, ""));
          
        if (c)
                ast_channel_unlock(c);