(info): `info' was not checking for all types of common files in
Windows, therefore could miss info files depending on the status (archive, read-only). Also changed the error message to user to provide a more accurate description of the problem. Closes #1018297.
This commit is contained in:
parent
7f73d82073
commit
9e670d8dc7
1 changed files with 13 additions and 2 deletions
|
@ -409,11 +409,22 @@ info(void)
|
||||||
strncat(filename, "*", sizeof(filename) - 1 - strlen(filename));
|
strncat(filename, "*", sizeof(filename) - 1 - strlen(filename));
|
||||||
hDir = FindFirstFile(filename, &fData);
|
hDir = FindFirstFile(filename, &fData);
|
||||||
if (hDir == INVALID_HANDLE_VALUE) {
|
if (hDir == INVALID_HANDLE_VALUE) {
|
||||||
|
switch (GetLastError()) {
|
||||||
|
case ERROR_FILE_NOT_FOUND:
|
||||||
|
pr("Sorry, there is no info on %s\n", bp);
|
||||||
|
break;
|
||||||
|
case ERROR_PATH_NOT_FOUND:
|
||||||
pr("Can't open info dir \"%s\"\n", infodir);
|
pr("Can't open info dir \"%s\"\n", infodir);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pr("Error getting info file \"%s\"\n", filename);
|
||||||
|
}
|
||||||
return RET_SYS;
|
return RET_SYS;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
if ((fData.dwFileAttributes == FILE_ATTRIBUTE_NORMAL) &&
|
if (((fData.dwFileAttributes == FILE_ATTRIBUTE_NORMAL) ||
|
||||||
|
(fData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE) ||
|
||||||
|
(fData.dwFileAttributes == FILE_ATTRIBUTE_READONLY)) &&
|
||||||
(strnccmp(bp, fData.cFileName, len) == 0)) {
|
(strnccmp(bp, fData.cFileName, len) == 0)) {
|
||||||
strncpy(filename, infodir, sizeof(filename) - 2);
|
strncpy(filename, infodir, sizeof(filename) - 2);
|
||||||
strcat(filename, "//");
|
strcat(filename, "//");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue