mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 10:58:15 +00:00
correct linku1() to handle the case tail = NULL correctly.
Now the function can be used to simplify other conditional blocks. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@24173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -179,14 +179,7 @@ file : objects { $$ = parseio->pval = $1; }
|
|||||||
objects : object {$$=$1;}
|
objects : object {$$=$1;}
|
||||||
| objects object
|
| objects object
|
||||||
{
|
{
|
||||||
if ( $1 && $2 ) {
|
$$ = linku1($1, $2);
|
||||||
$$=$1;
|
|
||||||
linku1($$,$2);
|
|
||||||
} else if ( $1 ) {
|
|
||||||
$$=$1;
|
|
||||||
} else if ( $2 ) {
|
|
||||||
$$=$2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
| objects error {$$=$1;}
|
| objects error {$$=$1;}
|
||||||
;
|
;
|
||||||
@@ -920,12 +913,13 @@ static pval * linku1(pval *head, pval *tail)
|
|||||||
{
|
{
|
||||||
if (!head)
|
if (!head)
|
||||||
return tail;
|
return tail;
|
||||||
if (!head->next) {
|
if (tail) {
|
||||||
head->next = tail;
|
if (!head->next) {
|
||||||
} else {
|
head->next = tail;
|
||||||
head->u1_last->next = tail;
|
} else {
|
||||||
|
head->u1_last->next = tail;
|
||||||
|
}
|
||||||
|
head->u1_last = tail;
|
||||||
}
|
}
|
||||||
head->u1_last = tail;
|
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user