1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
Index: newt-0.52.15/newt.c
===================================================================
--- newt-0.52.15.orig/newt.c 2013-05-15 15:00:08.000000000 +0100
+++ newt-0.52.15/newt.c 2013-05-15 15:11:45.000000000 +0100
@@ -1,5 +1,6 @@
#include "config.h"
+#define ENABLE_SLFUTURE_CONST 1
#include <slang.h>
#include <stdio.h>
#include <stdlib.h>
Index: newt-0.52.15/whiptcl.c
===================================================================
--- newt-0.52.15.orig/whiptcl.c 2013-03-25 14:16:36.000000000 +0000
+++ newt-0.52.15/whiptcl.c 2013-05-15 15:23:38.000000000 +0100
@@ -137,45 +137,44 @@
if (arg < -1) {
/* this could buffer oveflow, bug we're not setuid so I don't care */
- interp->result = malloc(200);
- interp->freeProc = TCL_DYNAMIC;
- sprintf(interp->result, "%s: %s\n",
+ char *result = Tcl_Alloc(200);
+ sprintf(result, "%s: %s\n",
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(arg));
-
+ Tcl_SetResult(interp, result, TCL_DYNAMIC);
return TCL_ERROR;
}
if (mode == MODE_NONE) {
- interp->result = "no dialog mode was specified";
+ Tcl_SetResult(interp, "no dialog mode was specified", TCL_STATIC);
return TCL_ERROR;
} else if (rc) {
- interp->result = "multiple modes were specified";
+ Tcl_SetResult(interp, "multiple modes were specified", TCL_STATIC);
return TCL_ERROR;
}
if (!(text = poptGetArg(optCon))) {
- interp->result = "missing text parameter";
+ Tcl_SetResult(interp, "missing text parameter", TCL_STATIC);
return TCL_ERROR;
}
if (!(nextArg = poptGetArg(optCon))) {
- interp->result = "height missing";
+ Tcl_setResult(interp,"height missing", TCL_STATIC);
return TCL_ERROR;
}
height = strtoul(nextArg, &end, 10);
if (*end) {
- interp->result = "height is not a number";
+ Tcl_SetResult(interp,"height is not a number", TCL_STATIC);
return TCL_ERROR;
}
if (!(nextArg = poptGetArg(optCon))) {
- interp->result = "width missing";
+ Tcl_SetResult(interp, "width missing", TCL_STATIC);
return TCL_ERROR;
}
width = strtoul(nextArg, &end, 10);
if (*end) {
- interp->result = "width is not a number";
+ Tcl_SetResult(interp, "width is not a number", TCL_STATIC);
return TCL_ERROR;
}
@@ -195,36 +194,28 @@
case MODE_YESNO:
rc = messageBox(text, height, width, MSGBOX_YESNO, flags);
- if (rc == DLG_OKAY)
- interp->result = "yes";
- else
- interp->result = "no";
+ Tcl_SetResult( interp, rc == DLG_OKAY ? "yes " : "no" , TCL_STATIC);
if (rc == DLG_ERROR) rc = 0;
break;
case MODE_INPUTBOX:
rc = inputBox(text, height, width, optCon, flags, &result);
if (rc ==DLG_OKAY) {
- interp->result = result;
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult( interp, result, TCL_DYNAMIC);
}
break;
case MODE_MENU:
rc = listBox(text, height, width, optCon, flags, default_item, &result);
if (rc==DLG_OKAY) {
- interp->result = result;
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, result, TCL_DYNAMIC);
}
break;
case MODE_RADIOLIST:
rc = checkList(text, height, width, optCon, 1, flags, &selections);
if (rc==DLG_OKAY) {
- interp->result = selections[0];
- interp->freeProc = TCL_DYNAMIC;
-
- free(selections);
+ Tcl_SetResult( interp, selections[0], TCL_DYNAMIC);
}
break;
@@ -247,7 +238,7 @@
newtPopWindow();
if (rc == DLG_ERROR) {
- interp->result = "bad paramter for whiptcl dialog box";
+ Tcl_SetResult(interp, "bad paramter for whiptcl dialog box", TCL_STATIC);
return TCL_ERROR;
}
|