diff options
author | obrien <obrien@FreeBSD.org> | 2000-06-20 06:55:50 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-06-20 06:55:50 +0000 |
commit | 971a426ec2c4d61ba96ef580d4ecda8f7133b100 (patch) | |
tree | 9acffbefd2007e3fafc159f7acc87ea10d627c1c /contrib/binutils | |
parent | 798c313587f725a19349e86c5db4bee75d9d14bc (diff) | |
download | FreeBSD-src-971a426ec2c4d61ba96ef580d4ecda8f7133b100.zip FreeBSD-src-971a426ec2c4d61ba96ef580d4ecda8f7133b100.tar.gz |
Merge in our rev 1.2 changes (but do it in a way the Binutils maintainers
accepted): Restore traditional behavior by acknowledging tabs in strings.
Diffstat (limited to 'contrib/binutils')
-rw-r--r-- | contrib/binutils/binutils/strings.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/contrib/binutils/binutils/strings.c b/contrib/binutils/binutils/strings.c index d3247ea..8bc618a 100644 --- a/contrib/binutils/binutils/strings.c +++ b/contrib/binutils/binutils/strings.c @@ -61,10 +61,27 @@ #include "bucomm.h" #include "libiberty.h" +/* Some platforms need to put stdin into binary mode, to read + binary files. */ +#ifdef HAVE_SETMODE +#ifndef O_BINARY +#ifdef _O_BINARY +#define O_BINARY _O_BINARY +#define setmode _setmode +#else +#define O_BINARY 0 +#endif +#endif +#if O_BINARY +#include <io.h> +#define SET_BINARY(f) do { if (!isatty(f)) setmode(f,O_BINARY); } while (0) +#endif +#endif + #ifdef isascii -#define isgraphic(c) (isascii (c) && (isprint (c) || isblank (c))) +#define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t')) #else -#define isgraphic(c) (isprint (c) || isblank (c)) +#define isgraphic(c) (isprint (c) || (c) == '\t') #endif #ifndef errno @@ -220,6 +237,9 @@ main (argc, argv) if (optind >= argc) { datasection_only = false; +#ifdef SET_BINARY + SET_BINARY (fileno (stdin)); +#endif print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL); files_given = true; } |