mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-19 03:07:59 +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
|
||||
{
|
||||
if ( $1 && $2 ) {
|
||||
$$=$1;
|
||||
linku1($$,$2);
|
||||
} else if ( $1 ) {
|
||||
$$=$1;
|
||||
} else if ( $2 ) {
|
||||
$$=$2;
|
||||
}
|
||||
$$ = linku1($1, $2);
|
||||
}
|
||||
| objects error {$$=$1;}
|
||||
;
|
||||
@@ -920,12 +913,13 @@ static pval * linku1(pval *head, pval *tail)
|
||||
{
|
||||
if (!head)
|
||||
return tail;
|
||||
if (!head->next) {
|
||||
head->next = tail;
|
||||
} else {
|
||||
head->u1_last->next = tail;
|
||||
if (tail) {
|
||||
if (!head->next) {
|
||||
head->next = tail;
|
||||
} else {
|
||||
head->u1_last->next = tail;
|
||||
}
|
||||
head->u1_last = tail;
|
||||
}
|
||||
head->u1_last = tail;
|
||||
return head;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user