From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 5/8] FAT: Fix file contents listed as directory
Date: Fri, 20 Jul 2012 15:20:29 +0200 (CEST) [thread overview]
Message-ID: <2017658963.332562.1342790429735.JavaMail.root@advansee.com> (raw)
In-Reply-To: <588056413.294128.1342735339884.JavaMail.root@advansee.com>
With:
fatls mmc 0 /dir/file
dir: regular directory
file: regular file
The previous code read the contents of file as if it were directory entries to
list. This patch refuses to list file contents as if it were a folder.
Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
---
Changes for v2:
- Patch renumbering because of the new v2 1/8.
- Possible code style changes due to the new v2 1/8.
.../fs/fat/fat.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git u-boot-66714b1.orig/fs/fat/fat.c u-boot-66714b1/fs/fat/fat.c
index fbc2d7d..5d08948 100644
--- u-boot-66714b1.orig/fs/fat/fat.c
+++ u-boot-66714b1/fs/fat/fat.c
@@ -1103,11 +1103,11 @@ rootdir_done:
goto exit;
}
- if (idx >= 0) {
- if (!(dentptr->attr & ATTR_DIR))
- goto exit;
+ if (isdir && !(dentptr->attr & ATTR_DIR))
+ goto exit;
+
+ if (idx >= 0)
subname = nextname;
- }
}
ret = get_contents(mydata, dentptr, buffer, maxsize);
next prev parent reply other threads:[~2012-07-20 13:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 22:02 [U-Boot] [PATCH 4/7] FAT: Fix file contents listed as directory Benoît Thébaudeau
2012-07-20 13:20 ` Benoît Thébaudeau [this message]
2012-09-02 15:21 ` [U-Boot] [PATCH v2 5/8] " Wolfgang Denk
2012-09-03 14:08 ` Benoît Thébaudeau
2012-09-18 19:03 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2017658963.332562.1342790429735.JavaMail.root@advansee.com \
--to=benoit.thebaudeau@advansee.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox