diff options
author | px4dev <px4@purgatory.org> | 2013-03-20 23:05:19 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-03-20 23:05:19 -0700 |
commit | db91dffb23cae1e8aa6c3945aa32b9d2e4ecd6a0 (patch) | |
tree | 0c6e8e86891285c45f7a60d857929a2a5e963599 /apps/system | |
parent | f7b14b2e23113093d1f76565041b91f22be79246 (diff) | |
parent | b7d65bf8fc65b2fd7c98d46d60fb24fb937baa94 (diff) | |
download | px4-firmware-db91dffb23cae1e8aa6c3945aa32b9d2e4ecd6a0.tar.gz px4-firmware-db91dffb23cae1e8aa6c3945aa32b9d2e4ecd6a0.tar.bz2 px4-firmware-db91dffb23cae1e8aa6c3945aa32b9d2e4ecd6a0.zip |
Merge branch 'master' into export-build
Diffstat (limited to 'apps/system')
-rw-r--r-- | apps/system/readline/readline.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/system/readline/readline.c b/apps/system/readline/readline.c index bac7eee8c..a8240a62a 100644 --- a/apps/system/readline/readline.c +++ b/apps/system/readline/readline.c @@ -126,7 +126,7 @@ static inline int readline_rawgetc(int infd) * error occurs). */ - do + for (;;) { /* Read one character from the incoming stream */ @@ -154,13 +154,21 @@ static inline int readline_rawgetc(int infd) { return -errcode; } + + continue; } - } - while (nread < 1); - /* On success, return the character that was read */ + else if (buffer == '\0') + { + /* Ignore NUL characters, since they look like EOF to our caller */ - return (int)buffer; + continue; + } + + /* Success, return the character that was read */ + + return (int)buffer; + } } /**************************************************************************** |