Цитата(BratherLU @ Oct 25 2013, 16:06)

немного подробностей:
Нашел глючок у Чана небольшой
Делаю многодисковую систему, при монтировании диска выскакивала ошибка, если был не 0й диск.
Ошибка в неучете изменения указателя пути и имени файла. Вот пофиксенная функция f_mount:
FRESULT f_mount (
FATFS* fs, /* Pointer to the file system object (NULL:unmount)*/
const TCHAR* path, /* Logical drive number to be mounted/unmounted */
BYTE opt /* 0:Do not mount (delayed mount), 1:Mount immediately */
)
{
FATFS *cfs;
int vol;
FRESULT res;
const TCHAR* cpath; //добавил копию указателя
cpath=path; //тоже
vol = get_ldnumber(&path);
if (vol < 0) return FR_INVALID_DRIVE;
cfs = FatFs[vol]; /* Pointer to fs object */
if (cfs) {
#if _FS_LOCK
clear_lock(cfs);
#endif
#if _FS_REENTRANT /* Discard sync object of the current volume */
if (!ff_del_syncobj(cfs->sobj)) return FR_INT_ERR;
#endif
cfs->fs_type = 0; /* Clear old fs object */
}
if (fs) {
fs->fs_type = 0; /* Clear new fs object */
#if _FS_REENTRANT /* Create sync object for the new volume */
if (!ff_cre_syncobj(vol, &fs->sobj)) return FR_INT_ERR;
#endif
}
FatFs[vol] = fs; /* Register new fs object */
if (!fs || opt != 1) return FR_OK; /* Do not mount now, it will be mounted later */
res = find_volume(&fs, &cpath, 0); /* Force mounted the volume - ИСПРАВЛЕНО! */
LEAVE_FF(fs, res);
}