* [gentoo-commits] gentoo-x86 commit in dev-libs/newt/files: newt-0.52.12-tcl.patch newt-0.52.14-tcl.patch
@ 2013-01-12 5:57 Naohiro Aota (naota)
0 siblings, 0 replies; only message in thread
From: Naohiro Aota (naota) @ 2013-01-12 5:57 UTC (permalink / raw
To: gentoo-commits
naota 13/01/12 05:57:16
Added: newt-0.52.12-tcl.patch newt-0.52.14-tcl.patch
Log:
Add patch to deal with tcl change #451356
(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key F8551514)
Revision Changes Path
1.1 dev-libs/newt/files/newt-0.52.12-tcl.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/newt/files/newt-0.52.12-tcl.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/newt/files/newt-0.52.12-tcl.patch?rev=1.1&content-type=text/plain
Index: newt-0.52.12-tcl.patch
===================================================================
diff --git a/whiptcl.c b/whiptcl.c
index 82c12ab..dfe1aeb 100644
--- a/whiptcl.c
+++ b/whiptcl.c
@@ -137,45 +137,45 @@ static int wtCmd(ClientData clientData, Tcl_Interp * interp, int argc,
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 *tmp = malloc(200);
+ sprintf(tmp, "%s: %s\n",
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(arg));
+ Tcl_SetResult(interp, tmp, TCL_DYNAMIC);
return TCL_ERROR;
}
if (mode == MODE_NONE) {
- interp->result = "no dialog mode was specified";
+ Tcl_SetResultString(interp, "no dialog mode was specified");
return TCL_ERROR;
} else if (rc) {
- interp->result = "multiple modes were specified";
+ Tcl_SetResultString(interp, "multiple modes were specified");
return TCL_ERROR;
}
if (!(text = poptGetArg(optCon))) {
- interp->result = "missing text parameter";
+ Tcl_SetResultString(interp, "missing text parameter");
return TCL_ERROR;
}
if (!(nextArg = poptGetArg(optCon))) {
- interp->result = "height missing";
+ Tcl_SetResultString(interp, "height missing");
return TCL_ERROR;
}
height = strtoul(nextArg, &end, 10);
if (*end) {
- interp->result = "height is not a number";
+ Tcl_SetResultString(interp, "height is not a number");
return TCL_ERROR;
}
if (!(nextArg = poptGetArg(optCon))) {
- interp->result = "width missing";
+ Tcl_SetResultString(interp, "width missing");
return TCL_ERROR;
}
width = strtoul(nextArg, &end, 10);
if (*end) {
- interp->result = "width is not a number";
+ Tcl_SetResultString(interp, "width is not a number");
return TCL_ERROR;
}
@@ -196,33 +196,30 @@ static int wtCmd(ClientData clientData, Tcl_Interp * interp, int argc,
case MODE_YESNO:
rc = messageBox(text, height, width, MSGBOX_YESNO, flags);
if (rc == DLG_OKAY)
- interp->result = "yes";
+ Tcl_SetResultString(interp, "yes");
else
- interp->result = "no";
+ Tcl_SetResultString(interp, "no");
if (rc == DLG_ERROR) rc = 0;
break;
case MODE_INPUTBOX:
rc = inputBox(text, height, width, optCon, flags, &result);
if (rc ==DLG_OKAY) {
- interp->result = strdup(result);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, strdup(result), TCL_DYNAMIC);
}
break;
case MODE_MENU:
rc = listBox(text, height, width, optCon, flags, default_item, &result);
if (rc==DLG_OKAY) {
- interp->result = strdup(result);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResult(interp, strdup(result), TCL_DYNAMIC);
}
break;
case MODE_RADIOLIST:
rc = checkList(text, height, width, optCon, 1, flags, &selections);
if (rc==DLG_OKAY) {
- interp->result = strdup(selections[0]);
- interp->freeProc = TCL_DYNAMIC;
+ Tcl_SetResultString(interp, strdup(selections[0]), TCL_DYNAMIC);
}
break;
@@ -245,7 +242,7 @@ static int wtCmd(ClientData clientData, Tcl_Interp * interp, int argc,
newtPopWindow();
if (rc == DLG_ERROR) {
- interp->result = "bad paramter for whiptcl dialog box";
+ Tcl_SetResultString(interp, "bad paramter for whiptcl dialog box");
return TCL_ERROR;
}
1.1 dev-libs/newt/files/newt-0.52.14-tcl.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/newt/files/newt-0.52.14-tcl.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/newt/files/newt-0.52.14-tcl.patch?rev=1.1&content-type=text/plain
Index: newt-0.52.14-tcl.patch
===================================================================
diff --git a/whiptcl.c b/whiptcl.c
index 8688780..7219911 100644
--- a/whiptcl.c
+++ b/whiptcl.c
@@ -137,45 +137,45 @@ static int wtCmd(ClientData clientData, Tcl_Interp * interp, int argc,
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 *tmp = malloc(200);
+ sprintf(tmp, "%s: %s\n",
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(arg));
+ Tcl_SetResult(interp, tmp, TCL_DYNAMIC);
return TCL_ERROR;
}
if (mode == MODE_NONE) {
- interp->result = "no dialog mode was specified";
+ Tcl_SetResultString(interp, "no dialog mode was specified");
return TCL_ERROR;
} else if (rc) {
- interp->result = "multiple modes were specified";
+ Tcl_SetResultString(interp, "multiple modes were specified");
return TCL_ERROR;
}
if (!(text = poptGetArg(optCon))) {
- interp->result = "missing text parameter";
+ Tcl_SetResultString(interp, "missing text parameter");
return TCL_ERROR;
}
if (!(nextArg = poptGetArg(optCon))) {
- interp->result = "height missing";
+ Tcl_SetResultString(interp, "height missing");
return TCL_ERROR;
}
height = strtoul(nextArg, &end, 10);
if (*end) {
- interp->result = "height is not a number";
+ Tcl_SetResultString(interp, "height is not a number");
return TCL_ERROR;
}
if (!(nextArg = poptGetArg(optCon))) {
- interp->result = "width missing";
+ Tcl_SetResultString(interp, "width missing");
return TCL_ERROR;
}
width = strtoul(nextArg, &end, 10);
if (*end) {
- interp->result = "width is not a number";
+ Tcl_SetResultString(interp, "width is not a number");
return TCL_ERROR;
}
@@ -196,33 +196,30 @@ static int wtCmd(ClientData clientData, Tcl_Interp * interp, int argc,
case MODE_YESNO:
rc = messageBox(text, height, width, MSGBOX_YESNO, flags);
if (rc == DLG_OKAY)
- interp->result = "yes";
+ Tcl_SetResultString(interp, "yes");
else
- interp->result = "no";
+ Tcl_SetResultString(interp, "no");
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;
+ Tcl_SetResult(interp, selections[0], TCL_DYNAMIC);
free(selections);
}
@@ -247,7 +244,7 @@ static int wtCmd(ClientData clientData, Tcl_Interp * interp, int argc,
newtPopWindow();
if (rc == DLG_ERROR) {
- interp->result = "bad paramter for whiptcl dialog box";
+ Tcl_SetResultString(interp, "bad paramter for whiptcl dialog box");
return TCL_ERROR;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-12 5:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-12 5:57 [gentoo-commits] gentoo-x86 commit in dev-libs/newt/files: newt-0.52.12-tcl.patch newt-0.52.14-tcl.patch Naohiro Aota (naota)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox