mirror of
https://github.com/reactos/reactos.git
synced 2024-09-12 05:43:24 +00:00
Sync to Wine-20050419:
Peter Berg Larsen <pebl@math.ku.dk> - Eliminate a strncpy and remove unused variable. svn path=/trunk/; revision=14724
This commit is contained in:
parent
37d076fdc0
commit
ee219b0e23
|
@ -2068,7 +2068,7 @@ struct cabinet *find_cabs_in_file(LPCSTR name, cab_UBYTE search_buf[])
|
||||||
*/
|
*/
|
||||||
void find_cabinet_file(char **cabname, LPCSTR origcab) {
|
void find_cabinet_file(char **cabname, LPCSTR origcab) {
|
||||||
|
|
||||||
char *tail, *cab, *name, *nextpart, nametmp[MAX_PATH], *filepart;
|
char *tail, *cab, *name, *nextpart, nametmp[MAX_PATH];
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
TRACE("(*cabname == ^%p, origcab == %s)\n", cabname ? *cabname : NULL, debugstr_a(origcab));
|
TRACE("(*cabname == ^%p, origcab == %s)\n", cabname ? *cabname : NULL, debugstr_a(origcab));
|
||||||
|
@ -2107,11 +2107,11 @@ void find_cabinet_file(char **cabname, LPCSTR origcab) {
|
||||||
nextpart = strchr(name, '\\');
|
nextpart = strchr(name, '\\');
|
||||||
if (nextpart) *nextpart = '\0';
|
if (nextpart) *nextpart = '\0';
|
||||||
|
|
||||||
found = SearchPathA(cab, name, NULL, MAX_PATH, nametmp, &filepart);
|
found = SearchPathA(cab, name, NULL, MAX_PATH, nametmp, NULL);
|
||||||
|
|
||||||
/* if the component was not found, look for it in the current dir */
|
/* if the component was not found, look for it in the current dir */
|
||||||
if (!found) {
|
if (!found) {
|
||||||
found = SearchPathA(".", name, NULL, MAX_PATH, nametmp, &filepart);
|
found = SearchPathA(".", name, NULL, MAX_PATH, nametmp, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
|
@ -2135,7 +2135,7 @@ void find_cabinet_file(char **cabname, LPCSTR origcab) {
|
||||||
if (found) {
|
if (found) {
|
||||||
free((void *) *cabname);
|
free((void *) *cabname);
|
||||||
*cabname = cab;
|
*cabname = cab;
|
||||||
strncpy(cab, nametmp, found+1);
|
memcpy(cab, nametmp, found+1);
|
||||||
TRACE("result: %s\n", debugstr_a(cab));
|
TRACE("result: %s\n", debugstr_a(cab));
|
||||||
} else {
|
} else {
|
||||||
free((void *) cab);
|
free((void *) cab);
|
||||||
|
|
Loading…
Reference in a new issue