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
21c85efd
Commit
21c85efd
authored
Aug 30, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Aug 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also recognize '/' as the start of an option.
Implement 'notepad /p'. Simplify many string parsing loops.
parent
8fa7ee26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
main.c
programs/notepad/main.c
+10
-9
No files found.
programs/notepad/main.c
View file @
21c85efd
...
...
@@ -199,14 +199,13 @@ static int AlertFileDoesNotExist(LPCWSTR szFileName)
static
void
HandleCommandLine
(
LPWSTR
cmdline
)
{
WCHAR
delimiter
;
int
opt_print
=
0
;
/* skip white space */
while
(
*
cmdline
&&
*
cmdline
==
' '
)
cmdline
++
;
while
(
*
cmdline
==
' '
)
cmdline
++
;
/* skip executable name */
delimiter
=
' '
;
if
(
*
cmdline
==
'"'
)
delimiter
=
'"'
;
delimiter
=
(
*
cmdline
==
'"'
?
'"'
:
' '
);
do
{
...
...
@@ -215,7 +214,7 @@ static void HandleCommandLine(LPWSTR cmdline)
while
(
*
cmdline
&&
*
cmdline
!=
delimiter
);
if
(
*
cmdline
==
delimiter
)
cmdline
++
;
while
(
*
cmdline
&&
(
*
cmdline
==
' '
||
*
cmdline
==
'-'
)
)
while
(
*
cmdline
==
' '
||
*
cmdline
==
'-'
||
*
cmdline
==
'/'
)
{
WCHAR
option
;
...
...
@@ -223,14 +222,14 @@ static void HandleCommandLine(LPWSTR cmdline)
option
=
*
cmdline
;
if
(
option
)
cmdline
++
;
while
(
*
cmdline
&&
*
cmdline
==
' '
)
cmdline
++
;
while
(
*
cmdline
==
' '
)
cmdline
++
;
switch
(
option
)
{
case
'p'
:
case
'P'
:
printf
(
"Print file: "
);
/* TODO - not yet able to print a file */
break
;
case
'P'
:
opt_print
=
1
;
break
;
}
}
...
...
@@ -275,6 +274,8 @@ static void HandleCommandLine(LPWSTR cmdline)
{
DoOpenFile
(
file_name
);
InvalidateRect
(
Globals
.
hMainWnd
,
NULL
,
FALSE
);
if
(
opt_print
)
DIALOG_FilePrint
();
}
else
{
...
...
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