Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
6c7a2eee
Commit
6c7a2eee
authored
Dec 17, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug when loading strings with linefeed fixed
parent
73a94d98
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
wb/lib/wb/src/wb_wblnode.cpp
wb/lib/wb/src/wb_wblnode.cpp
+15
-14
No files found.
wb/lib/wb/src/wb_wblnode.cpp
View file @
6c7a2eee
...
...
@@ -802,7 +802,7 @@ void wb_wblnode::buildAttr( ref_wblnode object, pwr_eBix bix)
pwr_eType
type
;
char
buf
[
2048
];
int
int_val
,
current_int_val
;
bool
add_newlin
e
=
false
;
bool
string_continu
e
=
false
;
switch
(
getType
())
{
case
tokens
.
ATTRIBUTE
:
...
...
@@ -836,10 +836,8 @@ void wb_wblnode::buildAttr( ref_wblnode object, pwr_eBix bix)
(
type
==
pwr_eType_String
||
type
==
pwr_eType_Text
))
{
// Index in string attribute marks a new row
int
index
=
n
.
attrIndex
();
if
(
index
>
0
)
{
add_newline
=
true
;
index
--
;
}
if
(
index
>
0
)
string_continue
=
true
;
offset
+=
index
;
size
=
size
-
index
;
}
...
...
@@ -872,12 +870,7 @@ void wb_wblnode::buildAttr( ref_wblnode object, pwr_eBix bix)
return
;
}
if
(
!
add_newline
)
strncpy
(
value
,
second_child
->
name
(),
sizeof
(
value
));
else
{
strncpy
(
&
value
[
1
],
second_child
->
name
(),
sizeof
(
value
)
-
1
);
value
[
0
]
=
'\n'
;
}
// printf( "Attr %s %s %d %d %s\n", object->name, name, size, offset, value);
if
(
size
==
sizeof
(
int_val
)
&&
convconst
(
&
int_val
,
value
))
{
...
...
@@ -905,13 +898,21 @@ void wb_wblnode::buildAttr( ref_wblnode object, pwr_eBix bix)
}
}
else
if
(
attrStringToValue
(
type
,
value
,
buf
,
sizeof
(
buf
),
size
))
{
if
(
bix
==
pwr_eBix_rt
||
bix
==
pwr_eBix_sys
)
if
(
bix
==
pwr_eBix_rt
||
bix
==
pwr_eBix_sys
)
{
if
(
string_continue
&&
!
*
(
char
*
)((
unsigned
int
)
object
->
o
->
rbody
+
offset
-
1
))
// If previous char is null, this was originally linefeed
*
(
char
*
)((
unsigned
int
)
object
->
o
->
rbody
+
offset
-
1
)
=
'\n'
;
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
o
->
rbody
+
offset
),
buf
,
size
);
else
if
(
bix
==
pwr_eBix_dev
)
}
else
if
(
bix
==
pwr_eBix_dev
)
{
if
(
string_continue
&&
!
*
(
char
*
)((
unsigned
int
)
object
->
o
->
dbody
+
offset
-
1
))
// If previous char is null, this was originally linefeed
*
(
char
*
)((
unsigned
int
)
object
->
o
->
dbody
+
offset
-
1
)
=
'\n'
;
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
o
->
dbody
+
offset
),
buf
,
size
);
}
}
else
{
// Attr conversion exception
m_vrep
->
error
(
"Unable to convert string to value"
,
getFileName
(),
line_number
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment