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
be4aff37
Commit
be4aff37
authored
Jan 12, 2004
by
Rein Klazes
Committed by
Alexandre Julliard
Jan 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle the cases when initdir is either invalid, or specifies a file.
parent
d0779463
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
filedlg.c
dlls/commdlg/filedlg.c
+24
-12
No files found.
dlls/commdlg/filedlg.c
View file @
be4aff37
...
...
@@ -1159,19 +1159,31 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
DWORD
result
;
strcpyW
(
tmpBuf
,
fodInfos
->
initdir
);
if
(
tmpBuf
[
strlenW
(
tmpBuf
)
-
1
]
!=
'\\'
)
{
strcatW
(
tmpBuf
,
szwSlash
);
if
(
PathFileExistsW
(
tmpBuf
)
)
{
/* initdir does not have to be a directory. If a file is
* specified, the dir part is taken */
if
(
PathIsDirectoryW
(
tmpBuf
))
{
if
(
tmpBuf
[
strlenW
(
tmpBuf
)
-
1
]
!=
'\\'
)
{
strcatW
(
tmpBuf
,
szwSlash
);
}
strcatW
(
tmpBuf
,
szwStar
);
}
result
=
GetFullPathNameW
(
tmpBuf
,
MAX_PATH
,
tmpBuf2
,
&
nameBit
);
if
(
result
)
{
*
nameBit
=
0x00
;
if
(
fodInfos
->
initdir
)
MemFree
(
fodInfos
->
initdir
);
fodInfos
->
initdir
=
MemAlloc
((
strlenW
(
tmpBuf2
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
fodInfos
->
initdir
,
tmpBuf2
);
handledPath
=
TRUE
;
TRACE
(
"Value in InitDir changed to %s
\n
"
,
debugstr_w
(
fodInfos
->
initdir
));
}
}
strcatW
(
tmpBuf
,
szwStar
);
result
=
GetFullPathNameW
(
tmpBuf
,
MAX_PATH
,
tmpBuf2
,
&
nameBit
);
if
(
result
)
{
*
nameBit
=
0x00
;
if
(
fodInfos
->
initdir
)
MemFree
(
fodInfos
->
initdir
);
fodInfos
->
initdir
=
MemAlloc
((
strlenW
(
tmpBuf2
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
fodInfos
->
initdir
,
tmpBuf2
);
handledPath
=
TRUE
;
TRACE
(
"Value in InitDir changed to %s
\n
"
,
debugstr_w
(
fodInfos
->
initdir
));
else
if
(
fodInfos
->
initdir
)
{
MemFree
(
fodInfos
->
initdir
);
fodInfos
->
initdir
=
NULL
;
TRACE
(
"Value in InitDir is not an existing path, changed to (nil)
\n
"
);
}
}
}
...
...
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