aboutsummaryrefslogtreecommitdiff
path: root/libXaw/src/TextAction.c
diff options
context:
space:
mode:
Diffstat (limited to 'libXaw/src/TextAction.c')
-rw-r--r--libXaw/src/TextAction.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libXaw/src/TextAction.c b/libXaw/src/TextAction.c
index 772f08d12..de34ce863 100644
--- a/libXaw/src/TextAction.c
+++ b/libXaw/src/TextAction.c
@@ -2282,7 +2282,7 @@ DoFormatText(TextWidget ctx, XawTextPosition left, Bool force, int level,
text.length = bytes;
bytes -= text.length;
if (_XawTextReplace(ctx, tmp, tmp, &text)) {
- XawStackFree(buf, text.ptr);
+ XawStackFree(text.ptr, buf);
return (XawEditError);
}
if (num_pos) {
@@ -2297,7 +2297,7 @@ DoFormatText(TextWidget ctx, XawTextPosition left, Bool force, int level,
}
position += count;
right += count;
- XawStackFree(buf, text.ptr);
+ XawStackFree(text.ptr, buf);
}
break;
}
@@ -3939,6 +3939,8 @@ FormParagraph(Widget w, XEvent *event, String *params, Cardinal *num_params)
}
if (FormRegion(ctx, from, to, pos, src->textSrc.num_text) == XawReplaceError) {
+ XawStackFree(pos, buf);
+ pos = buf;
#else
from = SrcScan(ctx->text.source, ctx->text.insertPos,
XawstParagraph, XawsdLeft, 1, False);
@@ -3947,7 +3949,6 @@ FormParagraph(Widget w, XEvent *event, String *params, Cardinal *num_params)
if (FormRegion(ctx, from, to, pos, 1) == XawReplaceError) {
#endif
- XawStackFree(pos, buf);
XBell(XtDisplay(w), 0);
#ifndef OLDXAW
if (undo) {
@@ -3995,13 +3996,13 @@ FormParagraph(Widget w, XEvent *event, String *params, Cardinal *num_params)
XawsdLeft, 1, False), False);
tw->text.clear_to_eol = True;
}
+ XawStackFree(pos, buf);
#else
ctx->text.old_insert = ctx->text.insertPos = *pos;
_XawTextBuildLineTable(ctx, SrcScan(ctx->text.source, ctx->text.lt.top,
XawstEOL, XawsdLeft, 1, False), False);
ctx->text.clear_to_eol = True;
#endif
- XawStackFree(pos, buf);
ctx->text.showposition = True;
EndAction(ctx);