Tools/DiskTook - Fixed absolute path support
authorJohn Hodge (sonata) <[email protected]>
Mon, 13 May 2013 07:09:24 +0000 (15:09 +0800)
committerJohn Hodge (sonata) <[email protected]>
Mon, 13 May 2013 07:09:24 +0000 (15:09 +0800)
Tools/DiskTool/actions.c
Tools/DiskTool/helpers.c
Tools/nativelib/threads.c

index 5cda588..448cb34 100644 (file)
@@ -15,7 +15,7 @@ extern int    NativeFS_Install(char **Arguments);
 extern int     LVM_Cleanup(void);
 
 // === PROTOTYPES ===
-void   DiskTool_Initialise(void)       __attribute__((constructor(101)));
+void   DiskTool_Initialise(void)       __attribute__((constructor(102)));
 void   DiskTool_Cleanup(void);
  int   DiskTool_int_TranslateOpen(const char *File, int Mode);
  int   DiskTool_LVM_Read(void *Handle, Uint64 Block, size_t BlockCount, void *Dest);
index f9e3bc4..f2aa26d 100644 (file)
@@ -61,12 +61,15 @@ size_t DiskTool_int_TranslatePath(char *Buffer, const char *Path)
                }
        
                len = strlen("/Native");
-               len += strlen( gsWorkingDirectory ) + 1;
+               if( Path[0] != '/' )
+                       len += strlen( gsWorkingDirectory ) + 1;
                len += strlen(Path);
                if( Buffer ) {
                        strcpy(Buffer, "/Native");
-                       strcat(Buffer, gsWorkingDirectory);
-                       strcat(Buffer, "/");
+                       if( Path[0] != '/' ) {
+                               strcat(Buffer, gsWorkingDirectory);
+                               strcat(Buffer, "/");
+                       }
                        strcat(Buffer, Path);
                }
        }
index aec7076..9a4bfdf 100644 (file)
@@ -22,8 +22,10 @@ tShortSpinlock       glThreadListLock;
 // === CODE ===
 void Threads_int_Init(void)
 {
-       lpThreads_This = Threads_int_CreateTCB(NULL);
-       Threads_SetName("ThreadZero");
+       if( !lpThreads_This ) {
+               lpThreads_This = Threads_int_CreateTCB(NULL);
+               Threads_SetName("ThreadZero");
+       }
 }
 
 tThread *Proc_GetCurThread(void)

UCC git Repository :: git.ucc.asn.au