freebsd-ports/editors/hexedit/files/patch--search.c
Edwin Groothuis 9ad713d54b [PATCH] update editors/hexedit to 1.2.12
This patch updates editors/hexedit to 1.2.12. Additionally
	included is a patch (patch-allowwhitespaces) which allows
	a hex search pattern to contain whitespaces (e.g. A1 B2 C3
	instead of A1B2C3).

PR:		ports/101078
Submitted by:	Andre Albsmeier <Andre.Albsmeier@siemens.com>
Approved by:	maintainer timeout
2007-09-24 12:32:54 +00:00

21 lines
534 B
C

--- search.c.orig Tue Nov 8 17:16:47 2005
+++ search.c Sat Jul 29 15:21:47 2006
@@ -30,6 +30,18 @@
if (!ask_about_save_and_redisplay()) return FALSE;
if (!displayMessageAndGetString(msg, last, tmp, tmp_size)) return FALSE;
+ if( hexOrAscii ) {
+ char* cp = tmp;
+ char* cp2 = tmp;
+ char c;
+ while( (c = *cp++) ) {
+ if( isspace( c ) )
+ continue;
+ *cp2++ = c;
+ }
+ *cp2 = '\0';
+ }
+
*sizea = strlen(tmp);
if (hexOrAscii) if (!hexStringToBinString(tmp, sizea)) return FALSE;