=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/fileio.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- src/usr.bin/mg/fileio.c 2008/09/15 16:11:35 1.82 +++ src/usr.bin/mg/fileio.c 2011/01/21 18:58:55 1.83 @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.82 2008/09/15 16:11:35 kjell Exp $ */ +/* $OpenBSD: fileio.c,v 1.83 2011/01/21 18:58:55 kjell Exp $ */ /* This file is in the public domain. */ @@ -529,10 +529,8 @@ while ((dent = readdir(dirp)) != NULL) { int isdir; - - if (dent->d_namlen < len || memcmp(cp, dent->d_name, len) != 0) + if (strncmp(cp, dent->d_name, len) != 0) continue; - isdir = 0; if (dent->d_type == DT_DIR) { isdir = 1;