This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
tiny oneliner for strings
- To: binutils at sourceware dot cygnus dot com
- Subject: tiny oneliner for strings
- From: Caolan McNamara <caolan at csn dot ul dot ie>
- Date: Thu, 27 Jul 2000 14:29:05 +0100 (IST)
Attached is tiny crude oneliner for strings to make it accept 16 bit
unicode characters which are just ascii expended to 16bits.
Handy with all windows apps etc moving to unicode. Suprisingly useful.
C.
p.s. (not on list)
Real Life: Caolan McNamara * Mobile: +49-177-2938135
Play: caolan@skynet.ie * Work Ph.: +49-40-23646-672
URL: http://www.csn.ul.ie/~caolan * Sig: an oblique strategy
Work at a different speed
--- binutils-2.10.old/binutils/strings.c Sun May 28 12:57:50 2000
+++ binutils-2.10/binutils/strings.c Thu Jul 27 14:43:59 2000
@@ -413,10 +413,13 @@
return;
}
address++;
- if (!isgraphic (c))
- /* Found a non-graphic. Try again starting with next char. */
- goto tryline;
- buf[i] = c;
+ if (c != 0)
+ {
+ if (!isgraphic (c))
+ /* Found a non-graphic. Try again starting with next char. */
+ goto tryline;
+ buf[i] = c;
+ }
}
/* We found a run of `string_min' graphic characters. Print up