summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-25 14:46:56 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-10-25 14:46:56 +0000
commit1e57186135611e477dfae2764800fa1744bc9b14 (patch)
tree2c4bd225d8692c4d37d7cf97c22167994f097906 /c/src/lib/libc
parentAdded code to correctly free any allocated space during the evaluation (diff)
downloadrtems-1e57186135611e477dfae2764800fa1744bc9b14.tar.bz2
Patch from Eric Valette <valette@crf.canon.fr> and Emmanuel Raguet
<raguet@crf.canon.fr> to use a local variable.
Diffstat (limited to 'c/src/lib/libc')
-rw-r--r--c/src/lib/libc/imfs_gtkn.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/c/src/lib/libc/imfs_gtkn.c b/c/src/lib/libc/imfs_gtkn.c
index aa63841725..d0689abdd3 100644
--- a/c/src/lib/libc/imfs_gtkn.c
+++ b/c/src/lib/libc/imfs_gtkn.c
@@ -25,24 +25,25 @@ IMFS_token_types IMFS_get_token(
int *token_len
)
{
- int i = 0;
+ register int i = 0;
IMFS_token_types type = IMFS_NAME;
+ register char c;
/*
* Copy a name into token. (Remember NULL is a token.)
*/
+ c = path[i];
+ while ( (!IMFS_is_separator(c)) && (i <= IMFS_NAME_MAX) ) {
- while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
-
- token[i] = path[i];
+ token[i] = c;
if (i == IMFS_NAME_MAX)
return IMFS_INVALID_TOKEN;
- if ( !IMFS_is_valid_name_char( token[i] ) )
+ if ( !IMFS_is_valid_name_char(c) )
type = IMFS_INVALID_TOKEN;
- i++;
+ c = path [++i];
}
/*
@@ -50,7 +51,7 @@ IMFS_token_types IMFS_get_token(
*/
if ( i == 0 ) {
- token[i] = path[i];
+ token[i] = c;
if ( token[i] != '\0' ) {
i++;