Cap5 support for zero-length long strings
This commit is contained in:
@@ -16,6 +16,11 @@ should also be read to understand what has changed since earlier releases.
|
||||
|
||||
<!-- Insert new items immediately below here ... -->
|
||||
|
||||
### Perl CA support for empty long strings
|
||||
|
||||
The Perl CA bindings have been fixed to handle zero-length long string data
|
||||
properly.
|
||||
|
||||
### `aao` gains `OMSL` and `DOL`
|
||||
|
||||
The `aao` record types gains the same `DOL` functionality found
|
||||
|
||||
@@ -208,6 +208,8 @@ SV * newSVdbr(struct event_handler_args *peha) {
|
||||
if (is_primitive) {
|
||||
if (value_type == DBR_CHAR) {
|
||||
/* Long string => Perl scalar */
|
||||
if (peha->count == 0)
|
||||
return newSVpvn(peha->dbr, 0);
|
||||
((char *)peha->dbr) [peha->count - 1] = 0;
|
||||
return newSVpv(peha->dbr, 0);
|
||||
}
|
||||
@@ -278,8 +280,12 @@ SV * newSVdbr(struct event_handler_args *peha) {
|
||||
char *str = dbr_value_ptr(peha->dbr, peha->type);
|
||||
|
||||
/* Long string => Perl scalar */
|
||||
str[peha->count - 1] = 0;
|
||||
val = newSVpv(str, 0);
|
||||
if (peha->count == 0)
|
||||
val = newSVpvn(str, 0);
|
||||
else {
|
||||
str[peha->count - 1] = 0;
|
||||
val = newSVpv(str, 0);
|
||||
}
|
||||
} else if (peha->count == 1) {
|
||||
/* Single value => Perl scalar */
|
||||
val = newSVdbf(value_type,
|
||||
|
||||
Reference in New Issue
Block a user