Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c60bc0c9
Commit
c60bc0c9
authored
Sep 07, 2001
by
Justin Santa Barbara
Committed by
Alexandre Julliard
Sep 07, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem with check for special characters.
parent
4014c74e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
58 deletions
+49
-58
write.c
tools/wmc/write.c
+49
-58
No files found.
tools/wmc/write.c
View file @
c60bc0c9
...
@@ -310,40 +310,31 @@ static char *make_string(WCHAR *uc, int len, int codepage)
...
@@ -310,40 +310,31 @@ static char *make_string(WCHAR *uc, int len, int codepage)
*
cptr
++
=
'"'
;
*
cptr
++
=
'"'
;
for
(
i
=
b
=
0
;
i
<
len
;
i
++
,
uc
++
)
for
(
i
=
b
=
0
;
i
<
len
;
i
++
,
uc
++
)
{
{
int
n
;
switch
(
*
uc
)
if
(
*
uc
<
0x100
)
{
{
case
'\a'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'a'
;
b
+=
2
;
break
;
if
(
isprint
(
*
uc
))
case
'\b'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'b'
;
b
+=
2
;
break
;
{
case
'\f'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'f'
;
b
+=
2
;
break
;
*
cptr
++
=
*
uc
;
case
'\n'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'n'
;
b
+=
2
;
break
;
b
++
;
case
'\r'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'r'
;
b
+=
2
;
break
;
}
case
'\t'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
't'
;
b
+=
2
;
break
;
else
case
'\v'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'v'
;
b
+=
2
;
break
;
{
case
'\\'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'\\'
;
b
+=
2
;
break
;
switch
(
*
uc
)
case
'"'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'"'
;
b
+=
2
;
break
;
{
default:
case
'\a'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'a'
;
b
+=
2
;
break
;
if
(
*
uc
<
0x100
&&
isprint
(
*
uc
))
case
'\b'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'b'
;
b
+=
2
;
break
;
{
case
'\f'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'f'
;
b
+=
2
;
break
;
*
cptr
++
=
*
uc
;
case
'\n'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'n'
;
b
+=
2
;
break
;
b
++
;
case
'\r'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'r'
;
b
+=
2
;
break
;
}
case
'\t'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
't'
;
b
+=
2
;
break
;
else
case
'\v'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'v'
;
b
+=
2
;
break
;
{
case
'\\'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'\\'
;
b
+=
2
;
break
;
int
n
=
sprintf
(
cptr
,
"
\\
x%04x"
,
*
uc
&
0xffff
);
case
'"'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'"'
;
b
+=
2
;
break
;
cptr
+=
n
;
default:
b
+=
n
;
n
=
sprintf
(
cptr
,
"
\\
x%04x"
,
*
uc
&
0xffff
);
}
cptr
+=
n
;
break
;
b
+=
n
;
}
}
}
}
else
{
n
=
sprintf
(
cptr
,
"
\\
x%04x"
,
*
uc
&
0xffff
);
cptr
+=
n
;
b
+=
n
;
}
if
(
i
<
len
-
1
&&
b
>=
72
)
if
(
i
<
len
-
1
&&
b
>=
72
)
{
{
*
cptr
++
=
'"'
;
*
cptr
++
=
'"'
;
...
@@ -381,30 +372,30 @@ static char *make_string(WCHAR *uc, int len, int codepage)
...
@@ -381,30 +372,30 @@ static char *make_string(WCHAR *uc, int len, int codepage)
*
cptr
++
=
'"'
;
*
cptr
++
=
'"'
;
for
(
i
=
b
=
0
;
i
<
len
;
i
++
,
cc
++
)
for
(
i
=
b
=
0
;
i
<
len
;
i
++
,
cc
++
)
{
{
int
n
;
switch
(
*
cc
)
if
(
isprint
(
*
cc
))
{
{
case
'\a'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'a'
;
b
+=
2
;
break
;
*
cptr
++
=
*
cc
;
case
'\b'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'b'
;
b
+=
2
;
break
;
b
++
;
case
'\f'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'f'
;
b
+=
2
;
break
;
}
case
'\n'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'n'
;
b
+=
2
;
break
;
else
case
'\r'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'r'
;
b
+=
2
;
break
;
{
case
'\t'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
't'
;
b
+=
2
;
break
;
switch
(
*
cc
)
case
'\v'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'v'
;
b
+=
2
;
break
;
{
case
'\\'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'\\'
;
b
+=
2
;
break
;
case
'\a'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'a
'
;
b
+=
2
;
break
;
case
'"'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'"
'
;
b
+=
2
;
break
;
case
'\b'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'b'
;
b
+=
2
;
break
;
default:
case
'\f'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'f'
;
b
+=
2
;
break
;
if
(
isprint
(
*
cc
))
case
'\n'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'n'
;
b
+=
2
;
break
;
{
case
'\r'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'r'
;
b
+=
2
;
break
;
*
cptr
++
=
*
cc
;
case
'\t'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
't'
;
b
+=
2
;
break
;
b
++
;
case
'\v'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'v'
;
b
+=
2
;
break
;
}
case
'\\'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'\\'
;
b
+=
2
;
break
;
else
case
'"'
:
*
cptr
++
=
'\\'
;
*
cptr
++
=
'"'
;
b
+=
2
;
break
;
{
default:
int
n
=
sprintf
(
cptr
,
"
\\
x%02x"
,
*
cc
&
0xff
);
n
=
sprintf
(
cptr
,
"
\\
x%02x"
,
*
cc
&
0xff
)
;
cptr
+=
n
;
cptr
+=
n
;
b
+=
n
;
b
+=
n
;
}
}
break
;
}
}
if
(
i
<
len
-
1
&&
b
>=
72
)
if
(
i
<
len
-
1
&&
b
>=
72
)
{
{
...
...
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