Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/canvas
Modified Files:
evas_object_textblock.c
Log Message:
accept escapes (\\, \", \', \ , etc.)
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_textblock.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -3 -r1.97 -r1.98
--- evas_object_textblock.c 14 Sep 2005 09:01:26 -0000 1.97
+++ evas_object_textblock.c 14 Sep 2005 12:37:42 -0000 1.98
@@ -833,7 +833,6 @@
if (fmt->font.source) free(fmt->font.source);
fmt->font.source = strdup(param);
new_font = 1;
- printf("font src: %s\n", fmt->font.source);
}
}
else if (!strcmp(cmd, "color"))
@@ -1097,7 +1096,7 @@
static char *
_format_parse(char **s)
{
- char *p, *item;
+ char *p, *item, *ss, *ds;
char *s1 = NULL, *s2 = NULL;
int quote = 0;
@@ -1114,12 +1113,18 @@
{
if (!quote)
{
- if (*p == '"') quote = 1;
- else if (*p == ' ') s2 = p;
+ if ((p > *s) && (p[-1] != '\\'))
+ {
+ if (*p == '"') quote = 1;
+ else if (*p == ' ') s2 = p;
+ }
}
else
{
- if (*p == '"') quote = 0;
+ if ((p > *s) && (p[-1] != '\\'))
+ {
+ if (*p == '"') quote = 0;
+ }
}
if (*p == 0) s2 = p;
}
@@ -1129,10 +1134,17 @@
item = malloc(s2 - s1 + 1);
if (item)
{
- strncpy(item, s1, s2 - s1);
- item[s2 - s1] = 0;
+ ds = item;
+ for (ds = item, ss = s1; ss < s2; ss++)
+ {
+ if ((*ss == '\\') && (ss < (s2 - 1))) ss++;
+ *ds = *ss;
+ ds++;
+ }
+ *ds = 0;
}
*s = s2;
+ printf("ITEM: %s\n", item);
return item;
}
}
@@ -1566,7 +1578,6 @@
Evas_List *remove_items = NULL, *l;
int index, p, ch, tw, th, inset, adv;
-// printf("_layout_walk_back_to_item_word_redo(...)\n");
/* it is not appended yet */
for (pit = (Evas_Object_Textblock_Item *)((Evas_Object_List
*)c->ln->items)->last;
pit;
@@ -2316,7 +2327,7 @@
}
else if (!val_stop)
{
- if ((*p) == '\'')
+ if (((*p) == '\'') && (p > ts->style_text) && (p[-1] != '\\'))
val_stop = p;
}
if ((key_start) && (key_stop) && (val_start) && (val_stop))
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs