summaryrefslogtreecommitdiff
path: root/recipes/mc/mc-4.6.2/99b_fix-regex-pattern-lengths.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/mc/mc-4.6.2/99b_fix-regex-pattern-lengths.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/mc/mc-4.6.2/99b_fix-regex-pattern-lengths.patch')
-rw-r--r--recipes/mc/mc-4.6.2/99b_fix-regex-pattern-lengths.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes/mc/mc-4.6.2/99b_fix-regex-pattern-lengths.patch b/recipes/mc/mc-4.6.2/99b_fix-regex-pattern-lengths.patch
new file mode 100644
index 0000000000..580c8345dd
--- /dev/null
+++ b/recipes/mc/mc-4.6.2/99b_fix-regex-pattern-lengths.patch
@@ -0,0 +1,53 @@
+--- mc-4.6.2/edit/editcmd.c
++++ mc-4.6.2/edit/editcmd.c
+@@ -1511,6 +1511,32 @@
+ sargs[argord[8]], sargs[argord[9]], sargs[argord[10]], sargs[argord[11]], \
+ sargs[argord[12]], sargs[argord[13]], sargs[argord[14]], sargs[argord[15]]
+
++#ifdef UTF8
++size_t
++real_mbstrlen (const char *str)
++{
++ if (SLsmg_Is_Unicode) {
++ size_t width = 0;
++
++ for (; *str; str++) {
++ wchar_t c;
++ size_t len;
++
++ len = mbrtowc (&c, str, MB_CUR_MAX, NULL);
++
++ if (len == (size_t)(-1) || len == (size_t)(-2)) break;
++
++ if (len > 0) {
++ width ++;
++ str += len-1;
++ }
++ }
++
++ return width;
++ } else
++ return strlen (str);
++}
++#endif
+
+ /* This function is a modification of mc-3.2.10/src/view.c:regexp_view_search() */
+ /* returns -3 on error in pattern, -1 on not found, found_len = 0 if either */
+@@ -1582,7 +1608,7 @@
+ continue;
+ tmp = string[pmatch[i].rm_so];
+ string[pmatch[i].rm_so] = 0;
+- new_o = mbstrlen(string);
++ new_o = real_mbstrlen(string);
+ string[pmatch[i].rm_so] = tmp;
+ pmatch[i].rm_so = new_o;
+
+@@ -1590,7 +1616,7 @@
+ continue;
+ tmp = string[pmatch[i].rm_eo];
+ string[pmatch[i].rm_eo] = 0;
+- new_o = mbstrlen(string);
++ new_o = real_mbstrlen(string);
+ string[pmatch[i].rm_eo] = tmp;
+ pmatch[i].rm_eo = new_o;
+ }