Tcl Source Code

Check-in [a6843c662e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Ugh; Tcl_DStringInit in wrong place...
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-1224888
Files: files | file ages | folders
SHA1: a6843c662ef1226fda710bcd44773fe8c6088e2d
User & Date: dkf 2011-10-13 21:04:15
Context
2011-10-31
19:41
re-generate configure (autoconf 2.13) check-in: b71c29a263 user: jan.nijtmans tags: bug-1224888
2011-10-13
21:04
Ugh; Tcl_DStringInit in wrong place... check-in: a6843c662e user: dkf tags: bug-1224888
12:34
Getting better; now possibly with autoconf magic! Comments too. check-in: fbc6fd24c0 user: dkf tags: bug-1224888
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/tclUnixFile.c.

68
69
70
71
72
73
74


75
76
77
78
79
80
81
    if (argv0 == NULL) {
	return NULL;
    }
    if (tclNativeExecutableName != NULL) {
	return tclNativeExecutableName;
    }



    /*
     * The executable name is sometimes available to us directly, which is
     * useful because it's not always there in argv[0]; that's a value that is
     * set by the code that invoked this process and it sometimes lies.  [Bug
     * 1224888]
     *
     * Our options for independently determining it are to scrape it out of







>
>







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    if (argv0 == NULL) {
	return NULL;
    }
    if (tclNativeExecutableName != NULL) {
	return tclNativeExecutableName;
    }

    Tcl_DStringInit(&buffer);

    /*
     * The executable name is sometimes available to us directly, which is
     * useful because it's not always there in argv[0]; that's a value that is
     * set by the code that invoked this process and it sometimes lies.  [Bug
     * 1224888]
     *
     * Our options for independently determining it are to scrape it out of
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    if (sym != NULL && dladdr(sym, &dlinfoBuffer)
	    && dlinfoBuffer.dli_fname[0] == '/') {
	name = dlinfoBuffer.dli_fname;
	goto gotName;
    }
#endif

    Tcl_DStringInit(&buffer);

    name = argv0;
    for (p = name; *p != '\0'; p++) {
	if (*p == '/') {
	    /*
	     * The name contains a slash, so use the name directly
	     * without doing a path search.
	     */







<
<







104
105
106
107
108
109
110


111
112
113
114
115
116
117
    if (sym != NULL && dladdr(sym, &dlinfoBuffer)
	    && dlinfoBuffer.dli_fname[0] == '/') {
	name = dlinfoBuffer.dli_fname;
	goto gotName;
    }
#endif



    name = argv0;
    for (p = name; *p != '\0'; p++) {
	if (*p == '/') {
	    /*
	     * The name contains a slash, so use the name directly
	     * without doing a path search.
	     */