- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
- * Ken Stevens, Steve McClure
+ * Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Ken Stevens, Steve McClure, Markus Armbruster
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
* Known contributors to this file:
* Dave Pare, 1986
* Mike Wise, 1997 - added apropos and case insensitivity
* Known contributors to this file:
* Dave Pare, 1986
* Mike Wise, 1997 - added apropos and case insensitivity
snprintf(filename, sizeof(filename), "%s/%s", infodir, name);
fp = fopen(filename, "r");
if (fp == NULL) {
snprintf(filename, sizeof(filename), "%s/%s", infodir, name);
fp = fopen(filename, "r");
if (fp == NULL) {
pr("Can't open info dir\n");
logerror("Can't open info dir \"%s\"\n", infodir);
pr("Can't open info dir\n");
logerror("Can't open info dir \"%s\"\n", infodir);
- snprintf(filename, sizeof(filename), "%s/%s", infodir,
- last);
+ snprintf(filename, sizeof(filename), "%s/%s", infodir, last);
fp = fopen(filename, "r");
if (fp == NULL) {
pr("Error reading info file for %s\n", name);
fp = fopen(filename, "r");
if (fp == NULL) {
pr("Error reading info file for %s\n", name);
logerror("Cannot fstat for \"%s\" info file (%s)",
filename, strerror(errno));
fclose(fp);
logerror("Cannot fstat for \"%s\" info file (%s)",
filename, strerror(errno));
fclose(fp);
pr("Error reading info file for %s\n", name);
logerror("The info file \"%s\" is not regular file\n", filename);
fclose(fp);
pr("Error reading info file for %s\n", name);
logerror("The info file \"%s\" is not regular file\n", filename);
fclose(fp);
- pr("Information on: %s Last modification date: %s",
- name, ctime(&statb.st_mtime));
- while (fgets(buf, sizeof(buf), fp) != 0)
+
+ while (fgets(buf, sizeof(buf), fp))
- snprintf(filename, sizeof(filename), "%s/%s", infodir,
- dp->d_name);
+ snprintf(filename, sizeof(filename), "%s/%s", infodir, dp->d_name);
snprintf(filename, sizeof(filename) - 1, "%s\\%s", infodir, name);
fp = fopen(filename, "rb");
if (fp == NULL) {
snprintf(filename, sizeof(filename) - 1, "%s\\%s", infodir, name);
fp = fopen(filename, "rb");
if (fp == NULL) {
switch (GetLastError()) {
case ERROR_FILE_NOT_FOUND:
pr("Sorry, there is no info on %s\n", name);
switch (GetLastError()) {
case ERROR_FILE_NOT_FOUND:
pr("Sorry, there is no info on %s\n", name);
default:
pr("Error reading info dir\n");
logerror("Error (%lu) reading info dir(%s)\\file(%s)",
default:
pr("Error reading info dir\n");
logerror("Error (%lu) reading info dir(%s)\\file(%s)",
- snprintf(filename, sizeof(filename), "%s/%s",
- infodir, last);
+ snprintf(filename, sizeof(filename), "%s/%s", infodir, last);
fp = fopen(filename, "rb");
if (fp == NULL) {
pr("Error reading info file for %s\n", name);
fp = fopen(filename, "rb");
if (fp == NULL) {
pr("Error reading info file for %s\n", name);
DWORD fAttrib = GetFileAttributes(filename);
if ((fAttrib == (DWORD)-1) || /* INVALID_FILE_ATTRIBUTES */
((fAttrib != FILE_ATTRIBUTE_NORMAL) &&
DWORD fAttrib = GetFileAttributes(filename);
if ((fAttrib == (DWORD)-1) || /* INVALID_FILE_ATTRIBUTES */
((fAttrib != FILE_ATTRIBUTE_NORMAL) &&
- snprintf(filename, sizeof(filename), "%s\\*",infodir);
+ snprintf(filename, sizeof(filename), "%s\\*", infodir);
hDir = FindFirstFile(filename, &fData);
if (hDir == INVALID_HANDLE_VALUE) {
if (GetLastError() == ERROR_PATH_NOT_FOUND) {
hDir = FindFirstFile(filename, &fData);
if (hDir == INVALID_HANDLE_VALUE) {
if (GetLastError() == ERROR_PATH_NOT_FOUND) {
} else {
pr("Error reading info dir\n");
logerror("Error (%lu) reading info dir(%s)\\file(%s)",
} else {
pr("Error reading info dir\n");
logerror("Error (%lu) reading info dir(%s)\\file(%s)",
(fData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE) ||
(fData.dwFileAttributes == FILE_ATTRIBUTE_READONLY))) {
snprintf(filename, sizeof(filename), "%s\\%s", infodir,
(fData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE) ||
(fData.dwFileAttributes == FILE_ATTRIBUTE_READONLY))) {
snprintf(filename, sizeof(filename), "%s\\%s", infodir,