summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs/msdos_misc.c
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2017-12-06 15:56:50 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-12-07 08:04:11 +0100
commitd438427cbe6ca8138d0c64b58a32a2b0ab4a6fa8 (patch)
treef7c76f890afff4c51226ff1e9d0c3d69b33b8880 /cpukit/libfs/src/dosfs/msdos_misc.c
parentdosfs: Fix files with same name as volume name. (diff)
downloadrtems-d438427cbe6ca8138d0c64b58a32a2b0ab4a6fa8.tar.bz2
dosfs: Allow creating a file with similar name.
If there is already a file with a long file name it isn't possible to create a second file which has a name that ends on the first files name (for example ets.beam and sets.beam). This patch fixes that. Close #3258.
Diffstat (limited to '')
-rw-r--r--cpukit/libfs/src/dosfs/msdos_misc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c
index 8953b0b5f4..7166485ed1 100644
--- a/cpukit/libfs/src/dosfs/msdos_misc.c
+++ b/cpukit/libfs/src/dosfs/msdos_misc.c
@@ -1564,9 +1564,13 @@ msdos_find_file_in_directory (
if (entry_matched)
{
if (lfn_entry ||
- lfn_checksum != msdos_lfn_checksum(entry))
- entry_matched = false;
- else if (name_len_remaining == 0) {
+ name_len_remaining > 0 ||
+ lfn_checksum != msdos_lfn_checksum(entry)) {
+ msdos_prepare_for_next_entry(&lfn_start,
+ &entry_matched,
+ &name_len_remaining,
+ name_len_for_compare);
+ } else if (name_len_remaining == 0) {
filename_matched = true;
rc = msdos_on_entry_found (
fs_info,