mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-20 12:20:12 +00:00
Merge Olle's comment patch (bug #3097)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -226,7 +226,7 @@ static int aPGSQL_connect(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l -1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
var=strsep(&stringp," ");
|
||||
optionstring=strsep(&stringp,"\n");
|
||||
|
||||
@@ -267,9 +267,9 @@ static int aPGSQL_query(struct ast_channel *chan, void *data) {
|
||||
s2=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
while (1) { // ugly trick to make branches with break;
|
||||
while (1) { /* ugly trick to make branches with break; */
|
||||
var=s3;
|
||||
s4=strsep(&stringp," ");
|
||||
id=atoi(s4);
|
||||
@@ -330,10 +330,10 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) {
|
||||
s2=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
fetchid_var=strsep(&stringp," ");
|
||||
while (1) { // ugly trick to make branches with break;
|
||||
var=fetchid_var; // fetchid
|
||||
while (1) { /* ugly trick to make branches with break; */
|
||||
var=fetchid_var; /* fetchid */
|
||||
fnd=0;
|
||||
|
||||
AST_LIST_TRAVERSE(headp,variables,entries) {
|
||||
@@ -350,19 +350,19 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) {
|
||||
}
|
||||
|
||||
s4=strsep(&stringp," ");
|
||||
id=atoi(s4); // resultid
|
||||
id=atoi(s4); /* resultid */
|
||||
if ((PGSQLres=find_identifier(id,AST_PGSQL_ID_RESID))==NULL) {
|
||||
ast_log(LOG_WARNING,"Invalid result identifier %d passed in aPGSQL_fetch\n",id);
|
||||
res=-1;
|
||||
break;
|
||||
}
|
||||
id=atoi(s7); //fetchid
|
||||
id=atoi(s7); /*fetchid */
|
||||
if ((lalares=find_identifier(id,AST_PGSQL_ID_FETCHID))==NULL) {
|
||||
i=0; // fetching the very first row
|
||||
i=0; /* fetching the very first row */
|
||||
} else {
|
||||
i=*lalares;
|
||||
free(lalares);
|
||||
del_identifier(id,AST_PGSQL_ID_FETCHID); // will re-add it a bit later
|
||||
del_identifier(id,AST_PGSQL_ID_FETCHID); /* will re-add it a bit later */
|
||||
}
|
||||
|
||||
if (i<PQntuples(PGSQLres)) {
|
||||
@@ -383,11 +383,11 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) {
|
||||
pbx_builtin_setvar_helper(chan,s5,s6);
|
||||
}
|
||||
lalares=malloc(sizeof(int));
|
||||
*lalares = ++i; // advance to the next row
|
||||
*lalares = ++i; /* advance to the next row */
|
||||
id1 = add_identifier(AST_PGSQL_ID_FETCHID,lalares);
|
||||
} else {
|
||||
ast_log(LOG_WARNING,"ast_PGSQL_fetch : EOF\n");
|
||||
id1 = 0; // no more rows
|
||||
id1 = 0; /* no more rows */
|
||||
}
|
||||
snprintf(s, sizeof(s), "%d", id1);
|
||||
ast_log(LOG_WARNING,"Setting var '%s' to value '%s'\n",fetchid_var,s);
|
||||
@@ -413,7 +413,7 @@ static int aPGSQL_reset(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
id=atoi(s3);
|
||||
if ((karoto=find_identifier(id,AST_PGSQL_ID_CONNID))==NULL) {
|
||||
@@ -439,7 +439,7 @@ static int aPGSQL_clear(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
id=atoi(s3);
|
||||
if ((karoto=find_identifier(id,AST_PGSQL_ID_RESID))==NULL) {
|
||||
@@ -469,7 +469,7 @@ static int aPGSQL_disconnect(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
id=atoi(s3);
|
||||
if ((karoto=find_identifier(id,AST_PGSQL_ID_CONNID))==NULL) {
|
||||
|
Reference in New Issue
Block a user