diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c
index 40f9f0f..9f8b57e 100644
a
|
b
|
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) |
285 | 285 | lfn_checksum != msdos_lfn_checksum(entry)) |
286 | 286 | lfn_start = FAT_FILE_SHORT_NAME; |
287 | 287 | |
| 288 | /* Re-initialise string size, because |
| 289 | * the converter below sets the new |
| 290 | * string length here. |
| 291 | * |
| 292 | * If the SFN checksum does not match |
| 293 | * the LFN checksum, lfn_start will be |
| 294 | * set to FAT_SHORT_FILE_NAME (above). |
| 295 | * So same goes for the conversion |
| 296 | * below - if size is not reinitialised, |
| 297 | * file name will be truncated to the |
| 298 | * length of the (invalid) LFN length. |
| 299 | * */ |
| 300 | string_size = sizeof(tmp_dirent.d_name); |
288 | 301 | eno = (*convert_handler->utf16_to_utf8) ( |
289 | 302 | converter, |
290 | 303 | lfn_buf, |
… |
… |
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) |
302 | 315 | |
303 | 316 | if (lfn_start == FAT_FILE_SHORT_NAME) |
304 | 317 | { |
| 318 | |
305 | 319 | /* |
306 | 320 | * convert dir entry from fixed 8+3 format (without dot) |
307 | 321 | * to 0..8 + 1dot + 0..3 format |
308 | 322 | */ |
309 | 323 | tmp_dirent.d_namlen = msdos_format_dirent_with_dot( |
310 | 324 | sfn_buf, entry); /* src text */ |
| 325 | |
| 326 | string_size = sizeof(tmp_dirent.d_name); |
311 | 327 | eno = (*convert_handler->codepage_to_utf8) ( |
312 | 328 | converter, |
313 | 329 | sfn_buf, |
… |
… |
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) |
325 | 341 | } |
326 | 342 | |
327 | 343 | if ( cmpltd >= 0 ) { |
| 344 | |
328 | 345 | memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent)); |
329 | 346 | |
330 | 347 | iop->offset = iop->offset + sizeof(struct dirent); |