Merge branch 'master' of git://cadel.mutabah.net/acess2
[tpg/acess2.git] / Tools / DiskTool / helpers.c
index f9e3bc4..7835169 100644 (file)
@@ -41,7 +41,7 @@ size_t DiskTool_int_TranslatePath(char *Buffer, const char *Path)
                const char *pos;
                for(pos = Path; pos < colon; pos ++)
                {
-                       if( !isalpha(*pos) )
+                       if( !isalnum(*pos) )
                                goto native_path;
                }
                
@@ -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);
                }
        }

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