Diff
Not logged in

Differences From Artifact [fd2fb1393b]:

To Artifact [fe492338c8]:


59
60
61
62
63
64
65

66
67
68
69
70
71
72
    const char *argv0)		/* The value of the application's argv[0]
				 * (native). */
{
    Tcl_Encoding encoding;
    const char *name, *p;
    Tcl_StatBuf statBuf;
    Tcl_DString buffer, nameString, cwd, utfName;


    if (argv0 == NULL) {
	return;
    }
    Tcl_DStringInit(&buffer);

    name = argv0;







>







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
    const char *argv0)		/* The value of the application's argv[0]
				 * (native). */
{
    Tcl_Encoding encoding;
    const char *name, *p;
    Tcl_StatBuf statBuf;
    Tcl_DString buffer, nameString, cwd, utfName;
    Tcl_Obj *obj;

    if (argv0 == NULL) {
	return;
    }
    Tcl_DStringInit(&buffer);

    name = argv0;
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
	    break;
	} else if (*(p+1) == 0) {
	    p = "./";
	} else {
	    p++;
	}
    }
	Tcl_Obj *obj;
	TclNewObj(obj);
    TclSetObjNameOfExecutable(obj, NULL);
    goto done;

    /*
     * If the name starts with "/" then just store it
     */








<
|







135
136
137
138
139
140
141

142
143
144
145
146
147
148
149
	    break;
	} else if (*(p+1) == 0) {
	    p = "./";
	} else {
	    p++;
	}
    }

    TclNewObj(obj);
    TclSetObjNameOfExecutable(obj, NULL);
    goto done;

    /*
     * If the name starts with "/" then just store it
     */

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
	TclSetObjNameOfExecutable(
		Tcl_NewStringObj(Tcl_DStringValue(&utfName), TCL_INDEX_NONE), encoding);
	Tcl_DStringFree(&utfName);
	goto done;
    }

    if (TclpGetCwd(NULL, &cwd) == NULL) {
	Tcl_Obj *obj;
	TclNewObj(obj);
	TclSetObjNameOfExecutable(obj, NULL);
	goto done;
    }

    /*
     * The name is relative to the current working directory. First strip off







<







159
160
161
162
163
164
165

166
167
168
169
170
171
172
	TclSetObjNameOfExecutable(
		Tcl_NewStringObj(Tcl_DStringValue(&utfName), TCL_INDEX_NONE), encoding);
	Tcl_DStringFree(&utfName);
	goto done;
    }

    if (TclpGetCwd(NULL, &cwd) == NULL) {

	TclNewObj(obj);
	TclSetObjNameOfExecutable(obj, NULL);
	goto done;
    }

    /*
     * The name is relative to the current working directory. First strip off