Changeset 6688079 in tol
- Timestamp:
- Mar 14, 2016, 12:49:45 PM (11 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- c6181a1
- Parents:
- 6755180
- Files:
-
- 4 edited
-
tol/init.cpp (modified) (6 diffs)
-
tolbase/generic/tolbase.c (modified) (1 diff)
-
toltcl/generic/tolsh.c (modified) (1 diff)
-
toltcl/generic/toltcl.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/init.cpp
r6755180 r6688079 22 22 #if defined(_MSC_VER) 23 23 #include <win_tolinc.h> 24 #endif 25 26 #if HAVE_UNISTD_H 27 #include <unistd.h> 24 28 #endif 25 29 … … 1545 1549 free(mode); 1546 1550 } 1547 InitGrammars(calledProgram); 1551 1552 const char * ptr = calledProgram; 1553 char realPath[1024]; 1554 1555 #ifdef HAVE_UNISTD_H 1556 ssize_t r = readlink( ptr, realPath, 1024 ); 1557 if ( r > 0 ) 1558 { 1559 realPath[r] = '\0'; 1560 ptr = realPath; 1561 } 1562 #endif 1563 1564 printf( "Inicializando con %s\n", ptr ); 1565 1566 InitGrammars( ptr ); 1548 1567 } 1549 1568 … … 1577 1596 bool loadInitProject = true; 1578 1597 bool loadDefaultPackages = true; 1598 1599 const char * argv0 = argv[0]; 1600 char realPath[1024]; 1601 1602 #ifdef HAVE_UNISTD_H 1603 ssize_t r = readlink( argv0, realPath, 1024 ); 1604 if ( r > 0 ) 1605 { 1606 realPath[r] = '\0'; 1607 argv0 = realPath; 1608 } 1609 #endif 1610 1579 1611 if(!helpMode) { 1580 1612 BInt i = 1; … … 1600 1632 else if (com == 'c') 1601 1633 { 1602 InitGrammars( argv[0]);1634 InitGrammars( argv0 ); 1603 1635 if(initTOL) { LoadInitLibrary(loadInitProject,loadDefaultPackages); } 1604 1636 Trace(I2("\nCompiling command line argument -c :\n", … … 1630 1662 else 1631 1663 { 1632 InitGrammars( argv[0]);1664 InitGrammars( argv0 ); 1633 1665 if(initTOL) { LoadInitLibrary(loadInitProject,loadDefaultPackages); } 1634 1666 if(arg.HasName()) { … … 1733 1765 if(dialogMode) 1734 1766 { 1735 InitGrammars( argv[0]);1767 InitGrammars( argv0 ); 1736 1768 // unused 1737 1769 /*aliveObjects_1 =*/ AliveObjects(); -
tolbase/generic/tolbase.c
r6755180 r6688079 178 178 //Tcl_PkgRequire( interp, "TolbaseApp", TOLBASE_VERSION, 1); 179 179 #else 180 const char* exeName = Tcl_GetNameOfExecutable(); 181 Tcl_VarEval( interp, "file join", 182 " [ file dir ", Tcl_GetNameOfExecutable(), 183 " ] tolbase.tcl", NULL ); 180 const char* argv0 = Tcl_GetNameOfExecutable(); 181 Tcl_VarEval( interp, "file join ", 182 "[ file dir [expr {[file type {", argv0, "}] eq {link} ? [file readlink {", argv0, "}] : {", argv0 ,"}} ] ] tolbase.tcl", NULL ); 184 183 Tcl_Obj *objPath = Tcl_GetObjResult( interp ); 185 184 Tcl_SetStartupScript( Tcl_GetObjResult( interp ), NULL ); -
toltcl/generic/tolsh.c
r6755180 r6688079 60 60 #if defined(WIN32) 61 61 SetupDllSearchPath( argv0 ); 62 Tcl_VarEval( interp, "lappend", " auto_path", " [file join", 63 " [file dir [file dir {", argv0, 64 "} ] ] lib ]", NULL ); 65 #else 66 Tcl_VarEval( interp, "lappend", " auto_path", " [file join", 67 " [file dir [file dir [expr {[file type {", argv0, "}] eq {link} ? [file readlink {", argv0, "}] : {", argv0 ,"}} ] ] ] lib ]", NULL ); 62 68 #endif 63 Tcl_VarEval( interp, "lappend", " auto_path", " [file join",64 " [file dir [file dir ", argv0,65 " ] ] lib ]", NULL );66 69 if ( !Tcl_PkgRequire( interp, "TolshApp", TOLTCL_VERSION, 1) ) 67 70 { -
toltcl/generic/toltcl.c
r6755180 r6688079 217 217 int lang; 218 218 char* vmode; 219 const char *argv0 = Tcl_GetNameOfExecutable(); 220 219 221 if (objc > 3) { 220 222 Tcl_AppendResult(interp, "wrong # args: should be \"", … … 246 248 */ 247 249 250 Tcl_VarEval( 248 251 InitTolKernel(Tcl_GetNameOfExecutable(), lang, vmode&&vmode[0]?vmode:NULL); 249 252
Note: See TracChangeset
for help on using the changeset viewer.
