This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

tiny oneliner for strings


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]