Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix things not working when there is a bind log #1695

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/tclhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,13 +1240,19 @@ void check_tcl_die(char *reason)
void check_tcl_log(int lv, char *chan, char *msg)
{
char mask[512];
Tcl_Obj* prev_result;

/* We have to store the old result, as check_tcl_bind may override it */
prev_result = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(prev_result);
egg_snprintf(mask, sizeof mask, "%s %s", chan, msg);
Tcl_SetVar(interp, "_log1", masktype(lv), TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "_log2", chan, TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "_log3", msg, TCL_GLOBAL_ONLY);
check_tcl_bind(H_log, mask, 0, " $::_log1 $::_log2 $::_log3",
MATCH_MASK | BIND_STACKABLE);
Tcl_SetObjResult(interp, prev_result);
Tcl_DecrRefCount(prev_result);
}

#ifdef TLS
Expand Down
Loading