Skip to content

Commit a75eaba

Browse files
author
cromwelldev
committed
Corrected paths to be UNIX style
1 parent c420e94 commit a75eaba

File tree

2 files changed

+5
-31
lines changed

2 files changed

+5
-31
lines changed

fs/VirtualRoot/VirtualRoot.c

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,9 @@ FileInfo vroot_stat(const char* path)
140140
char fullPath[300];
141141
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "path:\"%s\"", path);
142142

143-
while(cPathSep == *path)
144-
{
145-
path++;
146-
}
147-
148143
if(NULL != currentAccessor)
149144
{
150-
sprintf(fullPath, "%s%s", cwd, path);
145+
sprintf(fullPath, "%s"PathSep"%s", cwd, path);
151146
return currentAccessor->stat(fullPath);
152147
}
153148

@@ -171,10 +166,6 @@ int vroot_rename(const char* path, const char* newName)
171166
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "old:\"%s\" -> \"%s\"", path, newName);
172167
if(NULL != currentAccessor)
173168
{
174-
while(cPathSep == *path)
175-
{
176-
path++;
177-
}
178169
//TODO: Make sure newName has proper path */
179170
return currentAccessor->rename(path, newName);
180171
}
@@ -188,10 +179,6 @@ int vroot_mkdir(const char* path)
188179
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "path:\"%s\"", path);
189180
if(NULL != currentAccessor)
190181
{
191-
while(cPathSep == *path)
192-
{
193-
path++;
194-
}
195182
return currentAccessor->mkdir(path);
196183
}
197184
XBlastLogger(DEBUG_VROOT, DBG_LVL_ERROR, "Error!!! No file op in vroot.");
@@ -204,10 +191,6 @@ int vroot_remove(const char* path)
204191
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "path:\"%s\"", path);
205192
if(NULL != currentAccessor)
206193
{
207-
while(cPathSep == *path)
208-
{
209-
path++;
210-
}
211194
return currentAccessor->remove(path);
212195
}
213196
XBlastLogger(DEBUG_VROOT, DBG_LVL_ERROR, "Error!!! No file op in vroot.");
@@ -258,10 +241,6 @@ DIREX vroot_opendir(const char* path)
258241
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "path:\"%s\"", path);
259242
if(NULL != currentAccessor)
260243
{
261-
while(cPathSep == *path)
262-
{
263-
path++;
264-
}
265244
return currentAccessor->opendir(path);
266245
}
267246
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "Returning vroot handle.");
@@ -293,7 +272,7 @@ FileInfo vroot_readdir(DIREX handle)
293272
virtualRootCycler = FatFSAccess.getEntryName(virtualRootCycler, &string);
294273
if(NULL != string)
295274
{
296-
sprintf(returnStruct.name, "%s:", string);
275+
sprintf(returnStruct.name, "%s", string);
297276
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "found:\"%s\"", returnStruct.name);
298277
returnStruct.nameLength = strlen(returnStruct.name);
299278
}
@@ -332,11 +311,6 @@ static int pathProcess_Absolute(const char* const path)
332311
return 0;
333312
}
334313

335-
while(cPathSep == *sepPos)
336-
{
337-
sepPos++;
338-
}
339-
340314
result = FatFSAccess.chdir(sepPos);
341315
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "chdir:\"%s\" result:%u.", sepPos, result);
342316
if(0 == result)
@@ -356,10 +330,10 @@ static int pathProcess_GoingForward(const char* const path)
356330

357331
if(cPathSep != *path)
358332
{
359-
sprintf(fullPath, "%s%s"PathSep, cwd, path);
333+
sprintf(fullPath, "%s"PathSep"%s"PathSep, cwd, path);
360334
XBlastLogger(DEBUG_VROOT, DBG_LVL_DEBUG, "New path:\"%s\".", fullPath);
361335

362-
if(0 == FatFSAccess.chdir(fullPath + strlen(PathSep)))
336+
if(0 == FatFSAccess.chdir(fullPath))
363337
{
364338
currentAccessor = &FatFSAccess;
365339
strcpy(cwd, fullPath);

fs/ff13b/source/FatFSAccessor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ int fatxchdir(const char* path)
701701
{
702702
FRESULT result;
703703

704-
XBlastLogger(DEBUG_FATX_FS, DBG_LVL_DEBUG, "Result path:\"%s\"", path);
704+
XBlastLogger(DEBUG_FATX_FS, DBG_LVL_DEBUG, "path:\"%s\"", path);
705705

706706
result = f_chdir(path);
707707
XBlastLogger(DEBUG_FATX_FS, DBG_LVL_DEBUG, "result:%u", result);

0 commit comments

Comments
 (0)