Changeset 140637 for trunk/base


Ignore:
Timestamp:
Sep 28, 2015, 8:36:29 PM (5 years ago)
Author:
cal@…
Message:

base: tracelib: rename vars to avoid naming conflicts

Overwriting a variable named $path in the global context may actually cause
problems and is bad style. Let's use a prefixed variable that's likely unique
enough to avoid conflicts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/pextlib1.0/tracelib.c

    r140636 r140637  
    375375 */
    376376static void sandbox_violation(int sock UNUSED, const char *path, sandbox_violation_t type) {
    377     Tcl_SetVar(interp, "path", path, 0);
     377    Tcl_SetVar(interp, "_sandbox_viol_path", path, 0);
    378378    int retVal = TCL_OK;
    379379    switch (type) {
    380380        case SANDBOX_VIOLATION:
    381             retVal = Tcl_Eval(interp, "slave_add_sandbox_violation $path");
     381            retVal = Tcl_Eval(interp, "slave_add_sandbox_violation ${_sandbox_viol_path}");
    382382            break;
    383383        case SANDBOX_UNKNOWN:
    384             retVal = Tcl_Eval(interp, "slave_add_sandbox_unknown $path");
     384            retVal = Tcl_Eval(interp, "slave_add_sandbox_unknown ${_sandbox_viol_path}");
    385385            break;
    386386    }
     
    390390    }
    391391
    392     Tcl_UnsetVar(interp, "path", 0);
     392    Tcl_UnsetVar(interp, "_sandbox_viol_path", 0);
    393393}
    394394
Note: See TracChangeset for help on using the changeset viewer.