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
66119ad2
Commit
66119ad2
authored
Oct 20, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
find: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43572cbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
find.c
programs/find/find.c
+1
-2
find.c
programs/find/tests/find.c
+2
-3
No files found.
programs/find/find.c
View file @
66119ad2
...
...
@@ -117,7 +117,6 @@ static void write_to_stdout(const WCHAR *str)
static
BOOL
run_find_for_line
(
const
WCHAR
*
line
,
const
WCHAR
*
tofind
)
{
void
*
found
;
WCHAR
lineending
[]
=
{
'\r'
,
'\n'
,
0
};
if
(
lstrlenW
(
line
)
==
0
||
lstrlenW
(
tofind
)
==
0
)
return
FALSE
;
...
...
@@ -127,7 +126,7 @@ static BOOL run_find_for_line(const WCHAR *line, const WCHAR *tofind)
if
(
found
)
{
write_to_stdout
(
line
);
write_to_stdout
(
lineending
);
write_to_stdout
(
L"
\r\n
"
);
return
TRUE
;
}
...
...
programs/find/tests/find.c
View file @
66119ad2
...
...
@@ -128,7 +128,6 @@ static void mangle_text(const BYTE *input, int input_len, BYTE *output, int outp
static
void
run_find_stdin_
(
const
WCHAR
*
commandline
,
const
BYTE
*
input
,
int
input_len
,
const
BYTE
*
out_expected
,
int
out_expected_len
,
int
exitcode_expected
,
const
char
*
file
,
int
line
)
{
static
const
WCHAR
find_exe
[]
=
{
'f'
,
'i'
,
'n'
,
'd'
,
'.'
,
'e'
,
'x'
,
'e'
,
' '
,
'%'
,
's'
,
0
};
HANDLE
child_stdin_read
;
HANDLE
child_stdout_write
;
HANDLE
parent_stdin_write
;
...
...
@@ -157,7 +156,7 @@ static void run_find_stdin_(const WCHAR *commandline, const BYTE *input, int inp
startup_info
.
hStdError
=
NULL
;
startup_info
.
dwFlags
|=
STARTF_USESTDHANDLES
;
wsprintfW
(
cmd
,
find_exe
,
commandline
);
wsprintfW
(
cmd
,
L"find.exe %s"
,
commandline
);
CreateProcessW
(
NULL
,
cmd
,
NULL
,
NULL
,
TRUE
,
0
,
NULL
,
NULL
,
&
startup_info
,
&
process_info
);
CloseHandle
(
child_stdin_read
);
...
...
@@ -243,7 +242,7 @@ static void run_find_str_(const char *commandline, const char *input, const char
static
void
run_find_unicode_
(
const
BYTE
*
input
,
int
input_len
,
const
BYTE
*
out_expected
,
int
out_expected_len
,
int
exitcode_expected
,
BOOL
is_file
,
const
char
*
file
,
int
line
)
{
/* Need "test" as char and quoted wchar */
static
const
WCHAR
wstr_quoted_test
[]
=
{
'"'
,
't'
,
'e'
,
's'
,
't'
,
'"'
,
0
}
;
static
const
WCHAR
wstr_quoted_test
[]
=
L"
\"
test
\"
"
;
static
const
char
str_test
[]
=
"test"
;
BYTE
out_expected_mangled
[
200
]
=
{
0
};
...
...
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