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
d1d3db41
Commit
d1d3db41
authored
Nov 12, 2008
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Simplify REGPROC_export_string().
parent
7f707b30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
26 deletions
+14
-26
regproc.c
programs/regedit/regproc.c
+14
-26
No files found.
programs/regedit/regproc.c
View file @
d1d3db41
...
@@ -892,49 +892,37 @@ static void REGPROC_resize_char_buffer(WCHAR **buffer, DWORD *len, DWORD require
...
@@ -892,49 +892,37 @@ static void REGPROC_resize_char_buffer(WCHAR **buffer, DWORD *len, DWORD require
static
void
REGPROC_export_string
(
WCHAR
**
line_buf
,
DWORD
*
line_buf_size
,
DWORD
*
line_len
,
WCHAR
*
str
)
static
void
REGPROC_export_string
(
WCHAR
**
line_buf
,
DWORD
*
line_buf_size
,
DWORD
*
line_len
,
WCHAR
*
str
)
{
{
DWORD
len
=
lstrlenW
(
str
);
DWORD
len
=
lstrlenW
(
str
);
DWORD
i
;
DWORD
i
,
pos
;
DWORD
extra
=
0
;
DWORD
extra
=
0
;
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
10
);
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
10
);
/* escaping characters */
/* escaping characters */
pos
=
*
line_len
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
WCHAR
c
=
str
[
i
];
WCHAR
c
=
str
[
i
];
switch
(
c
)
{
switch
(
c
)
{
case
'\\'
:
case
'\n'
:
{
const
WCHAR
escape
[]
=
{
'\\'
,
'\\'
};
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
extra
+
1
);
memcpy
(
*
line_buf
+
*
line_len
+
i
+
extra
,
escape
,
2
*
sizeof
(
WCHAR
));
extra
++
;
extra
++
;
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
extra
);
(
*
line_buf
)[
pos
++
]
=
'\\'
;
(
*
line_buf
)[
pos
++
]
=
'n'
;
break
;
break
;
}
case
'"'
:
{
const
WCHAR
escape
[]
=
{
'\\'
,
'"'
};
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
extra
+
1
);
case
'\\'
:
memcpy
(
*
line_buf
+
*
line_len
+
i
+
extra
,
escape
,
2
*
sizeof
(
WCHAR
));
case
'"'
:
extra
++
;
extra
++
;
break
;
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
extra
);
}
(
*
line_buf
)[
pos
++
]
=
'\\'
;
case
'\n'
:
/* Fall through */
{
const
WCHAR
escape
[]
=
{
'\\'
,
'n'
};
REGPROC_resize_char_buffer
(
line_buf
,
line_buf_size
,
*
line_len
+
len
+
extra
+
1
);
memcpy
(
*
line_buf
+
*
line_len
+
i
+
extra
,
escape
,
2
*
sizeof
(
WCHAR
));
extra
++
;
break
;
}
default:
default:
memcpy
(
*
line_buf
+
*
line_len
+
i
+
extra
,
&
c
,
sizeof
(
WCHAR
))
;
(
*
line_buf
)[
pos
++
]
=
c
;
break
;
break
;
}
}
}
}
*
line_len
+=
len
+
extra
;
(
*
line_buf
)[
pos
]
=
'\0'
;
*
(
*
line_buf
+
*
line_len
)
=
0
;
*
line_len
=
pos
;
}
}
/******************************************************************************
/******************************************************************************
...
...
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