--- file-4.14/src/fsmagic.c.magic 2005-06-25 17:52:14.000000000 +0200 +++ file-4.14/src/fsmagic.c 2005-07-14 09:47:08.000000000 +0200 @@ -92,7 +92,8 @@ if (file_printf(ms, "cannot open `%s' (%s)", fn, strerror(errno)) == -1) return -1; - return 1; + ms->haderr++; + return -1; } if ((ms->flags & MAGIC_MIME) != 0) { --- file-4.14/src/file.c.magic 2005-03-06 06:58:22.000000000 +0100 +++ file-4.14/src/file.c 2005-07-14 09:47:08.000000000 +0200 @@ -362,7 +362,8 @@ } while (fgets(buf, MAXPATHLEN, f) != NULL) { - buf[file_mbswidth(buf)-1] = '\0'; + // cut off CR, we _need_ bytes here, not characters + buf[strlen(buf)-1] = '\0'; process(buf, wid); if(nobuffer) (void) fflush(stdout);