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
453996fe
Commit
453996fe
authored
Aug 20, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Aug 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/tests: Add @tab@ keyword recognition.
parent
6bd0671f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
batch.c
programs/cmd/tests/batch.c
+16
-2
No files found.
programs/cmd/tests/batch.c
View file @
453996fe
...
...
@@ -25,10 +25,11 @@
static
char
workdir
[
MAX_PATH
];
static
DWORD
workdir_len
;
/* Convert to DOS line endings, and substitute escaped
space
s with real ones */
/* Convert to DOS line endings, and substitute escaped
whitespace char
s with real ones */
static
const
char
*
convert_input_data
(
const
char
*
data
,
DWORD
size
,
DWORD
*
new_size
)
{
static
const
char
escaped_space
[]
=
{
'@'
,
's'
,
'p'
,
'a'
,
'c'
,
'e'
,
'@'
};
static
const
char
escaped_tab
[]
=
{
'@'
,
't'
,
'a'
,
'b'
,
'@'
};
DWORD
i
,
eol_count
=
0
;
char
*
ptr
,
*
new_data
;
...
...
@@ -48,6 +49,10 @@ static const char* convert_input_data(const char *data, DWORD size, DWORD *new_s
&&
!
memcmp
(
data
+
i
,
escaped_space
,
sizeof
(
escaped_space
)))
{
*
ptr
++
=
' '
;
i
+=
sizeof
(
escaped_space
)
-
1
;
}
else
if
(
data
+
i
+
sizeof
(
escaped_tab
)
-
1
<
data
+
size
&&
!
memcmp
(
data
+
i
,
escaped_tab
,
sizeof
(
escaped_tab
)))
{
*
ptr
++
=
'\t'
;
i
+=
sizeof
(
escaped_tab
)
-
1
;
}
else
{
*
ptr
++
=
data
[
i
];
}
...
...
@@ -150,6 +155,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const
static
const
char
pwd_cmd
[]
=
{
'@'
,
'p'
,
'w'
,
'd'
,
'@'
};
static
const
char
space_cmd
[]
=
{
'@'
,
's'
,
'p'
,
'a'
,
'c'
,
'e'
,
'@'
};
static
const
char
tab_cmd
[]
=
{
'@'
,
't'
,
'a'
,
'b'
,
'@'
};
static
const
char
or_broken_cmd
[]
=
{
'@'
,
'o'
,
'r'
,
'_'
,
'b'
,
'r'
,
'o'
,
'k'
,
'e'
,
'n'
,
'@'
};
while
(
exp_ptr
<
exp_end
)
{
...
...
@@ -174,7 +180,15 @@ static const char *compare_line(const char *out_line, const char *out_end, const
}
else
{
err
=
out_end
;
}
}
else
if
(
exp_ptr
+
sizeof
(
tab_cmd
)
<=
exp_end
&&
!
memcmp
(
exp_ptr
,
tab_cmd
,
sizeof
(
tab_cmd
)))
{
exp_ptr
+=
sizeof
(
tab_cmd
);
if
(
out_ptr
<
out_end
&&
*
out_ptr
==
'\t'
)
{
out_ptr
++
;
continue
;
}
else
{
err
=
out_end
;
}
}
else
if
(
exp_ptr
+
sizeof
(
or_broken_cmd
)
<=
exp_end
&&
!
memcmp
(
exp_ptr
,
or_broken_cmd
,
sizeof
(
or_broken_cmd
)))
{
if
(
out_ptr
==
out_end
)
...
...
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