Index: trunk/src/libcschem/cnc_text.c =================================================================== --- trunk/src/libcschem/cnc_text.c (revision 1818) +++ trunk/src/libcschem/cnc_text.c (revision 1819) @@ -309,10 +309,15 @@ int undoable) { undo_text_modify_t utmp, *u = &utmp; - char **text = (char **)text_; + char **text = (char **)text_, *tmp; if (undoable) u = uundo_append(&sheet->undo, &undo_text_modify, sizeof(undo_text_modify_t)); + if (text != NULL) { + tmp = rnd_strdup(*text); + text = &tmp; + } + u->texto = texto; u->spec1.x = (x1 == NULL) ? texto->spec1.x : *x1; u->spec1.y = (y1 == NULL) ? texto->spec1.y : *y1; Index: trunk/src/libcschem/cnc_text.h =================================================================== --- trunk/src/libcschem/cnc_text.h (revision 1818) +++ trunk/src/libcschem/cnc_text.h (revision 1819) @@ -75,6 +75,7 @@ csch_text_t *csch_text_get(csch_sheet_t *sheet, csch_cgrp_t *grp, csch_oid_t oid); void csch_text_update(csch_sheet_t *sheet, csch_text_t *text, int do_xform); +/* if text is not NULL, it's strdup'd */ void csch_text_modify(csch_sheet_t *sheet, csch_text_t *texto, csch_coord_t *x1, csch_coord_t *y1, csch_coord_t *x2, csch_coord_t *y2, double *rot, csch_halign_t *halign, const char **text, int *has_bbox, int *dyntext,