aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1996-12-20 22:19:18 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1996-12-20 22:19:18 +0000
commit4205b53dc0e0793230c96f0bd351893fded6c862 (patch)
tree30b46c08a9b535272266e7e44c3e03a1295b6291 /usr.bin
parentedb2a14fa4eb152031c73a367a06cbd3df3c10d9 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/file/ascmagic.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/file/ascmagic.c b/usr.bin/file/ascmagic.c
index 4280b5180ae4c..2250bba5cd99c 100644
--- a/usr.bin/file/ascmagic.c
+++ b/usr.bin/file/ascmagic.c
@@ -36,7 +36,7 @@
#ifndef lint
static char *moduleid =
- "@(#)$Id: ascmagic.c,v 1.2 1995/05/30 06:29:59 rgrimes Exp $";
+ "@(#)$Id: ascmagic.c,v 1.3 1996/01/23 12:40:06 mpp Exp $";
#endif /* lint */
/* an optimisation over plain strcmp() */
@@ -88,6 +88,12 @@ int nbytes; /* size actually read */
return 1;
}
+
+ for (i = 0; i < nbytes; i++) {
+ if (!isascii(buf[i]))
+ return 0; /* not all ASCII */
+ }
+
/* look for tokens from names.h - this is expensive! */
/* make a copy of the buffer here because strtok() will destroy it */
s = (unsigned char*) memcpy(nbuf, buf, nbytes);
@@ -106,12 +112,6 @@ int nbytes; /* size actually read */
}
}
-
- for (i = 0; i < nbytes; i++) {
- if (!isascii(buf[i]))
- return 0; /* not all ASCII */
- }
-
/* all else fails, but it is ASCII... */
ckfputs("ASCII text", stdout);
if (has_escapes) {