Skip to content

Commit

Permalink
Fix for cat command on mmcfs files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnyder committed Feb 4, 2010
1 parent 9604c94 commit d636724
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/mmcfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ static int mmcfs_open_r( struct _reent *r, const char *path, int flags, int mode
strcat(mmc_pathBuf, "/");
strcat(mmc_pathBuf, path);

// Scrub binary flag, if defined
#ifdef O_BINARY
flags &= ~O_BINARY;
#endif

// Translate fcntl.h mode to FatFs mode (by jcwren@jcwren.com)
if (((flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC)) && (flags & (O_RDWR | O_WRONLY)))
mmc_mode = FA_CREATE_ALWAYS;
Expand Down
2 changes: 1 addition & 1 deletion src/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static void shell_cat( char *args )
{
p = strchr( args, ' ' );
*p = 0;
if( ( fp = fopen( args , "rb" ) ) != NULL )
if( ( fp = fopen( args , "rb" ) ) != NULL )
{
c = fgetc( fp );
while( c != EOF )
Expand Down

0 comments on commit d636724

Please sign in to comment.