Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
668e44ab
Commit
668e44ab
authored
Feb 11, 2012
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Feb 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Respect constant wide strings naming convention.
parent
7cf307a7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
28 deletions
+28
-28
batch.c
programs/cmd/batch.c
+7
-7
builtins.c
programs/cmd/builtins.c
+9
-9
directory.c
programs/cmd/directory.c
+2
-2
wcmd.h
programs/cmd/wcmd.h
+2
-2
wcmdmain.c
programs/cmd/wcmdmain.c
+8
-8
No files found.
programs/cmd/batch.c
View file @
668e44ab
...
...
@@ -475,13 +475,13 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
int
datelen
;
doneModifier
=
TRUE
;
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
W
);
/* Format the time */
FileTimeToSystemTime
(
&
fileInfo
.
ftLastWriteTime
,
&
systime
);
GetDateFormatW
(
LOCALE_USER_DEFAULT
,
DATE_SHORTDATE
,
&
systime
,
NULL
,
thisoutput
,
MAX_PATH
);
strcatW
(
thisoutput
,
space
);
strcatW
(
thisoutput
,
space
W
);
datelen
=
strlenW
(
thisoutput
);
GetTimeFormatW
(
LOCALE_USER_DEFAULT
,
TIME_NOSECONDS
,
&
systime
,
NULL
,
(
thisoutput
+
datelen
),
MAX_PATH
-
datelen
);
...
...
@@ -497,14 +497,14 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
static
const
WCHAR
fmt
[]
=
{
'%'
,
'u'
,
'\0'
};
doneModifier
=
TRUE
;
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
W
);
wsprintfW
(
thisoutput
,
fmt
,
fullsize
);
strcatW
(
finaloutput
,
thisoutput
);
}
/* 4. Handle 's' : Use short paths (File doesn't have to exist) */
if
(
memchrW
(
firstModifier
,
's'
,
modifierLen
)
!=
NULL
)
{
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
W
);
/* Don't flag as doneModifier - %~s on its own is processed later */
GetShortPathNameW
(
outputparam
,
outputparam
,
sizeof
(
outputparam
)
/
sizeof
(
outputparam
[
0
]));
}
...
...
@@ -513,7 +513,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
/* Note this overrides d,p,n,x */
if
(
memchrW
(
firstModifier
,
'f'
,
modifierLen
)
!=
NULL
)
{
doneModifier
=
TRUE
;
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
W
);
strcatW
(
finaloutput
,
fullfilename
);
}
else
{
...
...
@@ -523,7 +523,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
WCHAR
ext
[
MAX_PATH
];
BOOL
doneFileModifier
=
FALSE
;
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
W
);
/* Split into components */
WCMD_splitpath
(
fullfilename
,
drive
,
dir
,
fname
,
ext
);
...
...
@@ -560,7 +560,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
if
(
!
doneFileModifier
&&
memchrW
(
firstModifier
,
's'
,
modifierLen
)
!=
NULL
)
{
doneModifier
=
TRUE
;
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
W
);
strcatW
(
finaloutput
,
outputparam
);
}
}
...
...
programs/cmd/builtins.c
View file @
668e44ab
...
...
@@ -349,7 +349,7 @@ void WCMD_choice (const WCHAR * command) {
ptr
=
strchrW
(
opt_c
,
answer
[
0
]);
if
(
ptr
)
{
WCMD_output_asis
(
answer
);
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
if
(
have_console
)
SetConsoleMode
(
GetStdHandle
(
STD_INPUT_HANDLE
),
oldmode
);
...
...
@@ -954,7 +954,7 @@ void WCMD_echo (const WCHAR *command)
echo_mode
=
FALSE
;
else
{
WCMD_output_asis
(
command
);
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
}
HeapFree
(
GetProcessHeap
(),
0
,
trimmed
);
}
...
...
@@ -2101,7 +2101,7 @@ void WCMD_setshow_default (const WCHAR *command) {
GetCurrentDirectoryW
(
sizeof
(
cwd
)
/
sizeof
(
WCHAR
),
cwd
);
if
(
strlenW
(
command
)
==
0
)
{
strcatW
(
cwd
,
newline
);
strcatW
(
cwd
,
newline
W
);
WCMD_output_asis
(
cwd
);
}
else
{
...
...
@@ -2264,7 +2264,7 @@ static int WCMD_setshow_sortenv(const WCHAR *s, const WCHAR *stub)
/* Don't display special internal variables */
if
(
str
[
i
][
0
]
!=
'='
)
{
WCMD_output_asis
(
str
[
i
]);
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
displayedcount
++
;
}
}
...
...
@@ -2368,7 +2368,7 @@ void WCMD_setshow_path (const WCHAR *command) {
if
(
status
!=
0
)
{
WCMD_output_asis
(
pathEqW
);
WCMD_output_asis
(
string
);
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
}
else
{
WCMD_output_stderr
(
WCMD_LoadMessage
(
WCMD_NOPATH
));
...
...
@@ -2488,7 +2488,7 @@ void WCMD_start(const WCHAR *command)
strcatW
(
file
,
exeW
);
cmdline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
file
)
+
strlenW
(
command
)
+
2
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
cmdline
,
file
);
strcatW
(
cmdline
,
space
);
strcatW
(
cmdline
,
space
W
);
strcatW
(
cmdline
,
command
);
memset
(
&
st
,
0
,
sizeof
(
STARTUPINFOW
)
);
...
...
@@ -2879,7 +2879,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
if
(
rc
==
ERROR_SUCCESS
)
{
WCMD_output_asis
(
keyValue
);
}
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
RegCloseKey
(
readKey
);
}
}
...
...
@@ -2909,7 +2909,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
WCMD_output_asis
(
equalW
);
/* If no default value found, leave line empty after '=' */
if
(
rc
==
ERROR_SUCCESS
)
WCMD_output_asis
(
keyValue
);
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
RegCloseKey
(
readKey
);
}
else
{
...
...
@@ -2982,7 +2982,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
WCMD_output_asis
(
command
);
WCMD_output_asis
(
equalW
);
WCMD_output_asis
(
newValue
);
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
}
}
}
...
...
programs/cmd/directory.c
View file @
668e44ab
...
...
@@ -316,7 +316,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
/* Output the results */
if
(
!
bare
)
{
if
(
level
!=
0
&&
(
entry_count
>
0
))
WCMD_output_asis
(
newline
);
if
(
level
!=
0
&&
(
entry_count
>
0
))
WCMD_output_asis
(
newline
W
);
if
(
!
recurse
||
((
entry_count
>
0
)
&&
done_header
==
FALSE
))
{
static
const
WCHAR
headerW
[]
=
{
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'o'
,
'r'
,
'y'
,
' '
,
'o'
,
'f'
,
' '
,
'%'
,
'1'
,
'\n'
,
'\n'
,
'\0'
};
...
...
@@ -446,7 +446,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
}
}
}
if
(
addNewLine
)
WCMD_output_asis
(
newline
);
if
(
addNewLine
)
WCMD_output_asis
(
newline
W
);
cur_width
=
0
;
}
...
...
programs/cmd/wcmd.h
View file @
668e44ab
...
...
@@ -231,8 +231,8 @@ extern BATCH_CONTEXT *context;
#define WCMD_EXIT 45
/* Some standard messages */
extern
const
WCHAR
newline
[];
extern
const
WCHAR
space
[];
extern
const
WCHAR
newline
W
[];
extern
const
WCHAR
space
W
[];
extern
const
WCHAR
nullW
[];
extern
const
WCHAR
dotW
[];
extern
const
WCHAR
dotdotW
[];
...
...
programs/cmd/wcmdmain.c
View file @
668e44ab
...
...
@@ -44,8 +44,8 @@ int defaultColor = 7;
BOOL
echo_mode
=
TRUE
;
WCHAR
anykey
[
100
],
version_string
[
100
];
const
WCHAR
newline
[]
=
{
'\r'
,
'\n'
,
'\0'
};
const
WCHAR
space
[]
=
{
' '
,
'\0'
};
const
WCHAR
newline
W
[]
=
{
'\r'
,
'\n'
,
'\0'
};
const
WCHAR
space
W
[]
=
{
' '
,
'\0'
};
static
BOOL
opt_c
,
opt_k
,
opt_s
,
unicodeOutput
=
FALSE
;
...
...
@@ -318,7 +318,7 @@ void WCMD_print_error (void) {
WCMD_output_asis_len
(
lpMsgBuf
,
lstrlenW
(
lpMsgBuf
),
GetStdHandle
(
STD_ERROR_HANDLE
));
LocalFree
(
lpMsgBuf
);
WCMD_output_asis_len
(
newline
,
lstrlenW
(
newline
),
WCMD_output_asis_len
(
newline
W
,
lstrlenW
(
newlineW
),
GetStdHandle
(
STD_ERROR_HANDLE
));
return
;
}
...
...
@@ -1550,7 +1550,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
WCMD_type
(
p
);
break
;
case
WCMD_VER
:
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
WCMD_version
();
break
;
case
WCMD_VERIFY
:
...
...
@@ -1813,7 +1813,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
if
(
strlenW
(
extraSpace
)
==
MAXSTRING
-
1
)
{
WCMD_output_asis_stderr
(
WCMD_LoadMessage
(
WCMD_TRUNCATEDLINE
));
WCMD_output_asis_stderr
(
extraSpace
);
WCMD_output_asis_stderr
(
newline
);
WCMD_output_asis_stderr
(
newline
W
);
}
/* Replace env vars if in a batch context */
...
...
@@ -1834,9 +1834,9 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
&&
CompareStringW
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
extraSpace
,
min_len
,
echoCol
,
len
)
!=
CSTR_EQUAL
)
{
WCMD_output_asis
(
space
);
WCMD_output_asis
(
space
W
);
}
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
}
/* Start with an empty string, copying to the command string */
...
...
@@ -2172,7 +2172,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
/* Continue to echo commands IF echo is on and in batch program */
if
(
context
&&
echo_mode
&&
extraSpace
[
0
]
&&
(
extraSpace
[
0
]
!=
'@'
))
{
WCMD_output_asis
(
extraSpace
);
WCMD_output_asis
(
newline
);
WCMD_output_asis
(
newline
W
);
}
}
}
...
...
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