On Tue, Sep 08, 2009 at 03:55:13PM +0000, Roman Divacky wrote:
> +              * Detect whether this is a text file.  The correct way to
> +              * do this is to check the least significant bit of the
> +              * "internal file attributes" field of the corresponding
> +              * file header in the central directory, but libarchive
> +              * does not read the central directory, so we have to
> +              * guess by looking for non-ASCII characters in the
> +              * buffer.  Hopefully we won't guess wrong.  If we do
> +              * guess wrong, we print a warning message later.
> +              */
> +             if (a_opt && n == 0) {
> +                     for (p = buffer; p < end; ++p) {
> +                             if (!isascii((unsigned char)*p)) {
> +                                     text = 0;
> +                                     break;
> +                             }
> +                     }
> +             }
> +

If I understand the purpose of this code right, better use
isalnum()+ispunct()+ispace()
combination to count non-ASCII people too.
Also setlocale() call must be added to the main() for that.

-- 
http://ache.pp.ru/
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to