*/}}
YimingWu 5 天之前
父節點
當前提交
5af4b93603
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      la_data.c

+ 8 - 6
la_data.c

@@ -2230,9 +2230,11 @@ void la_GetWorkingDirectoryInternal(){
     char mbuf[2048];
 #ifdef LA_LINUX
     readlink("/proc/self/exe", mbuf, 2048);
+    strDiscardLastSegmentSeperateBy(mbuf, '/');
 #endif
 #ifdef _WIN32
     GetModuleFileName(NULL, mbuf, 2048);
+    strDiscardLastSegmentSeperateBy(mbuf, '\\');
 #endif
     int len=strlen(mbuf);if(mbuf[len]!=LA_PATH_SEP){ mbuf[len]=LA_PATH_SEP; mbuf[len+1]=0; }
     strSafeSet(&MAIN.WorkingDirectory, mbuf);
@@ -3648,10 +3650,10 @@ laManagedUDF* la_EnsureManagedUDF(char* FileName, int PutAtTop){
     return m;
 }
 void la_MakeDummyManagedUDF(){
-    MAIN.DummyManageUDF=la_EnsureManagedUDF("< Save as a new file >", 1);
+    MAIN.DummyManageUDF=la_EnsureManagedUDF(transLate("< Save as a new file >"), 1);
     if(!MAIN.DummyManageUDFSingle){
-        MAIN.DummyManageUDFSingle=memAcquire(sizeof(laManagedUDF)); strSafeSet(&MAIN.DummyManageUDFSingle->BaseName, "< Choose file >");
-        MAIN.DummyManageUDFSingleForce=memAcquire(sizeof(laManagedUDF)); strSafeSet(&MAIN.DummyManageUDFSingleForce->BaseName, "< Force >");
+        MAIN.DummyManageUDFSingle=memAcquire(sizeof(laManagedUDF)); strSafeSet(&MAIN.DummyManageUDFSingle->BaseName, transLate("< Choose file >"));
+        MAIN.DummyManageUDFSingleForce=memAcquire(sizeof(laManagedUDF)); strSafeSet(&MAIN.DummyManageUDFSingleForce->BaseName, transLate("< Force >"));
     }
 }
 laManagedSaveProp* laSaveProp(char* path){
@@ -4652,12 +4654,12 @@ void laRedo(){ laDiff* d; if(d=laSwapDBState(1)){ la_ExecUndoPtrSync(d); laNotif
 
 void laPrintDBInst(laDBInst* dbi, int Level){
     if(dbi!=&MAIN.RootDBInst){
-        printf("%*c", Level, ' ');
-        printf("%s  |  %.6x [%.6x] %.6x  |  %.6x [%.6x] %.6x\n",
+        logPrintNew("%*c", Level, ' ');
+        logPrint("%s  |  %.6x [%.6x] %.6x  |  %.6x [%.6x] %.6x\n",
             dbi->pc->Identifier, dbi->Item.pPrev, dbi, dbi->Item.pNext,
             dbi->Item.pPrev?((laDBInst*)dbi->Item.pPrev)->OriginalInstance:0, dbi->OriginalInstance, dbi->Item.pNext?((laDBInst*)dbi->Item.pNext)->OriginalInstance:0);
     }else{
-        printf("Root:\n");
+        logPrintNew("Root:\n");
     }
     for(laDBProp* dbp=dbi->Props.pFirst;dbp;dbp=dbp->Item.pNext){
         if(dbp->p->PropertyType==LA_PROP_SUB && !dbp->p->UDFIsRefer){