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
22508e57
Commit
22508e57
authored
Mar 17, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FindFirstFile can return an empty short name if the long name is a
valid DOS name, fixed callers to handle that properly.
parent
ffbb75fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
29 deletions
+25
-29
listbox.c
controls/listbox.c
+9
-5
pidl.c
dlls/shell32/pidl.c
+4
-20
int21.c
dlls/winedos/int21.c
+12
-4
No files found.
controls/listbox.c
View file @
22508e57
...
...
@@ -1766,10 +1766,12 @@ static LRESULT LISTBOX_Directory( HWND hwnd, LB_DESCR *descr, UINT attrib,
static
const
WCHAR
bracketW
[]
=
{
']'
,
0
};
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
if
(
!
(
attrib
&
DDL_DIRECTORY
)
||
!
strcmpW
(
entry
.
c
Alternate
FileName
,
dotW
))
continue
;
!
strcmpW
(
entry
.
cFileName
,
dotW
))
continue
;
buffer
[
0
]
=
'['
;
if
(
long_names
)
strcpyW
(
buffer
+
1
,
entry
.
cFileName
);
else
strcpyW
(
buffer
+
1
,
entry
.
cAlternateFileName
);
if
(
!
long_names
&&
entry
.
cAlternateFileName
[
0
])
strcpyW
(
buffer
+
1
,
entry
.
cAlternateFileName
);
else
strcpyW
(
buffer
+
1
,
entry
.
cFileName
);
strcatW
(
buffer
,
bracketW
);
}
else
/* not a directory */
...
...
@@ -1781,8 +1783,10 @@ static LRESULT LISTBOX_Directory( HWND hwnd, LB_DESCR *descr, UINT attrib,
((
attrib
&
ATTRIBS
)
!=
(
entry
.
dwFileAttributes
&
ATTRIBS
)))
continue
;
#undef ATTRIBS
if
(
long_names
)
strcpyW
(
buffer
,
entry
.
cFileName
);
else
strcpyW
(
buffer
,
entry
.
cAlternateFileName
);
if
(
!
long_names
&&
entry
.
cAlternateFileName
[
0
])
strcpyW
(
buffer
+
1
,
entry
.
cAlternateFileName
);
else
strcpyW
(
buffer
+
1
,
entry
.
cFileName
);
}
if
(
!
long_names
)
CharLowerW
(
buffer
);
pos
=
LISTBOX_FindFileStrPos
(
hwnd
,
descr
,
buffer
);
...
...
dlls/shell32/pidl.c
View file @
22508e57
...
...
@@ -1578,16 +1578,8 @@ LPITEMIDLIST _ILCreateFolder( WIN32_FIND_DATAA * stffile )
memcpy
(
pbuff
,
stffile
->
cFileName
,
len
);
pbuff
+=
len
;
if
(
stffile
->
cAlternateFileName
)
{
len1
=
strlen
(
stffile
->
cAlternateFileName
)
+
1
;
memcpy
(
pbuff
,
stffile
->
cAlternateFileName
,
len1
);
}
else
{
len1
=
1
;
*
pbuff
=
0x00
;
}
len1
=
strlen
(
stffile
->
cAlternateFileName
)
+
1
;
memcpy
(
pbuff
,
stffile
->
cAlternateFileName
,
len1
);
pidl
=
_ILCreate
(
PT_FOLDER
,
(
LPVOID
)
buff
,
len
+
len1
);
...
...
@@ -1618,16 +1610,8 @@ LPITEMIDLIST _ILCreateValue(WIN32_FIND_DATAA * stffile)
memcpy
(
pbuff
,
stffile
->
cFileName
,
len
);
pbuff
+=
len
;
if
(
stffile
->
cAlternateFileName
)
{
len1
=
strlen
(
stffile
->
cAlternateFileName
)
+
1
;
memcpy
(
pbuff
,
stffile
->
cAlternateFileName
,
len1
);
}
else
{
len1
=
1
;
*
pbuff
=
0x00
;
}
len1
=
strlen
(
stffile
->
cAlternateFileName
)
+
1
;
memcpy
(
pbuff
,
stffile
->
cAlternateFileName
,
len1
);
pidl
=
_ILCreate
(
PT_VALUE
,
(
LPVOID
)
buff
,
len
+
len1
);
...
...
dlls/winedos/int21.c
View file @
22508e57
...
...
@@ -3754,7 +3754,8 @@ static unsigned INT21_FindHelper(LPCWSTR fullPath, unsigned drive, unsigned coun
count
++
;
/* Check the file attributes, and path */
if
(
!
(
entry
->
dwFileAttributes
&
~
search_attr
)
&&
match_short
(
entry
->
cAlternateFileName
,
mask
))
match_short
(
entry
->
cAlternateFileName
[
0
]
?
entry
->
cAlternateFileName
:
entry
->
cFileName
,
mask
))
{
return
count
;
}
...
...
@@ -3787,8 +3788,12 @@ static int INT21_FindNext( CONTEXT86 *context )
dta
->
fileattr
=
entry
.
dwFileAttributes
;
dta
->
filesize
=
entry
.
nFileSizeLow
;
FileTimeToDosDateTime
(
&
entry
.
ftLastWriteTime
,
&
dta
->
filedate
,
&
dta
->
filetime
);
WideCharToMultiByte
(
CP_OEMCP
,
0
,
entry
.
cAlternateFileName
,
-
1
,
dta
->
filename
,
13
,
NULL
,
NULL
);
if
(
entry
.
cAlternateFileName
[
0
])
WideCharToMultiByte
(
CP_OEMCP
,
0
,
entry
.
cAlternateFileName
,
-
1
,
dta
->
filename
,
13
,
NULL
,
NULL
);
else
WideCharToMultiByte
(
CP_OEMCP
,
0
,
entry
.
cFileName
,
-
1
,
dta
->
filename
,
13
,
NULL
,
NULL
);
if
(
!
memchr
(
dta
->
mask
,
'?'
,
11
))
{
/* wildcardless search, release resources in case no findnext will
...
...
@@ -3887,7 +3892,10 @@ static int INT21_FindNextFCB( CONTEXT86 *context )
&
pResult
->
filedate
,
&
pResult
->
filetime
);
/* Convert file name to FCB format */
INT21_ToDosFCBFormat
(
entry
.
cAlternateFileName
,
nameW
);
if
(
entry
.
cAlternateFileName
[
0
])
INT21_ToDosFCBFormat
(
entry
.
cAlternateFileName
,
nameW
);
else
INT21_ToDosFCBFormat
(
entry
.
cFileName
,
nameW
);
WideCharToMultiByte
(
CP_OEMCP
,
0
,
nameW
,
11
,
pResult
->
filename
,
11
,
NULL
,
NULL
);
return
1
;
}
...
...
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