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
e8fa5df3
Commit
e8fa5df3
authored
Feb 23, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Feb 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Add %random% special name support.
parent
98ae8a69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
wcmdmain.c
programs/cmd/wcmdmain.c
+12
-2
No files found.
programs/cmd/wcmdmain.c
View file @
e8fa5df3
...
...
@@ -318,8 +318,8 @@ void WCMD_process_command (char *command)
/* Expand environment variables in a batch file %{0-9} first */
/* including support for any ~ modifiers */
/* Additionally: */
/* Expand the DATE, TIME, CD
and ERRORLEVEL special names
*/
/*
allowing environment variable overrides
*/
/* Expand the DATE, TIME, CD
, RANDOM and ERRORLEVEL special
*/
/*
names allowing environment variable overrides
*/
/* FIXME: Winnt would replace %1%fred%1 with first parm, then */
/* contents of fred, then the digit 1. Would need to remove */
...
...
@@ -399,6 +399,16 @@ void WCMD_process_command (char *command)
strcpy
(
p
,
temp
);
strcat
(
p
,
s
);
}
else
if
((
CompareString
(
LOCALE_USER_DEFAULT
,
NORM_IGNORECASE
|
SORT_STRINGSORT
,
(
p
+
1
),
7
,
"RANDOM%"
,
-
1
)
==
2
)
&&
(
GetEnvironmentVariable
(
"RANDOM"
,
temp
,
1
)
==
0
)
&&
(
GetLastError
()
==
ERROR_ENVVAR_NOT_FOUND
))
{
sprintf
(
temp
,
"%d"
,
rand
()
%
32768
);
s
=
strdup
(
p
+
8
);
strcpy
(
p
,
temp
);
strcat
(
p
,
s
);
}
else
{
p
++
;
}
...
...
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