diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-25 14:46:56 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-10-25 14:46:56 +0000 |
commit | 1e57186135611e477dfae2764800fa1744bc9b14 (patch) | |
tree | 2c4bd225d8692c4d37d7cf97c22167994f097906 /c/src/exec/libfs/src | |
parent | Added code to correctly free any allocated space during the evaluation (diff) | |
download | rtems-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/exec/libfs/src')
-rw-r--r-- | c/src/exec/libfs/src/imfs/imfs_gtkn.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/c/src/exec/libfs/src/imfs/imfs_gtkn.c b/c/src/exec/libfs/src/imfs/imfs_gtkn.c index aa63841725..d0689abdd3 100644 --- a/c/src/exec/libfs/src/imfs/imfs_gtkn.c +++ b/c/src/exec/libfs/src/imfs/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++; |