Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/usr.bin/file Pull up revisions 1.20-1.21 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/c5b7288fd282
branches:  netbsd-1-6
changeset: 529847:c5b7288fd282
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sun Jan 05 08:46:48 2003 +0000

description:
Pull up revisions 1.20-1.21 (requested by is in ticket #1045)
 Actually return a different code for big-endian UTF-16 in looks_unicode().
 Fixes PR 19487.

diffstat:

 usr.bin/file/ascmagic.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r f68ca7c32803 -r c5b7288fd282 usr.bin/file/ascmagic.c
--- a/usr.bin/file/ascmagic.c   Sun Jan 05 08:44:03 2003 +0000
+++ b/usr.bin/file/ascmagic.c   Sun Jan 05 08:46:48 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ascmagic.c,v 1.17 2001/09/09 10:46:36 pooka Exp $      */
+/*     $NetBSD: ascmagic.c,v 1.17.2.1 2003/01/05 08:46:48 jmc Exp $    */
 
 /*
  * ASCII magic -- file types that we know based on keywords
@@ -52,7 +52,7 @@
 #if 0
 FILE_RCSID("@(#)Id: ascmagic.c,v 1.30 2001/07/26 13:15:49 christos Exp ")
 #else
-__RCSID("$NetBSD: ascmagic.c,v 1.17 2001/09/09 10:46:36 pooka Exp $");
+__RCSID("$NetBSD: ascmagic.c,v 1.17.2.1 2003/01/05 08:46:48 jmc Exp $");
 #endif
 #endif /* lint */
 
@@ -564,6 +564,10 @@
        return gotone;   /* don't claim it's UTF-8 if it's all 7-bit */
 }
 
+/*
+ * returns 1 for little-endian, 2 for big-endian UTF-16
+ * 0 for neither
+ */
 static int
 looks_unicode(buf, nbytes, ubuf, ulen)
        const unsigned char *buf;
@@ -600,7 +604,7 @@
                        return 0;
        }
 
-       return 1;
+       return (1+bigend);
 }
 
 #undef F



Home | Main Index | Thread Index | Old Index