Changeset 1e57186 in rtems


Ignore:
Timestamp:
Oct 25, 1999, 2:46:56 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
9cc603ff
Parents:
04df848
Message:

Patch from Eric Valette <valette@…> and Emmanuel Raguet
<raguet@…> to use a local variable.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libfs/src/imfs/imfs_gtkn.c

    r04df848 r1e57186  
    2626)
    2727{
    28   int              i = 0;
     28  register int i = 0;
    2929  IMFS_token_types  type = IMFS_NAME;
     30  register char c;
    3031
    3132  /*
    3233   *  Copy a name into token.  (Remember NULL is a token.)
    3334   */
     35  c = path[i];
     36  while ( (!IMFS_is_separator(c)) && (i <= IMFS_NAME_MAX) ) {
    3437
    35   while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
    36 
    37      token[i] = path[i];
     38     token[i] = c;
    3839
    3940     if (i == IMFS_NAME_MAX)
    4041       return IMFS_INVALID_TOKEN;
    4142
    42      if ( !IMFS_is_valid_name_char( token[i] ) )
     43     if ( !IMFS_is_valid_name_char(c) )
    4344       type = IMFS_INVALID_TOKEN;   
    4445
    45      i++;
     46     c = path [++i];
    4647  }
    4748
     
    5152
    5253  if ( i == 0 ) {
    53     token[i] = path[i];
     54    token[i] = c;
    5455
    5556    if ( token[i] != '\0' ) {
  • c/src/lib/libc/imfs_gtkn.c

    r04df848 r1e57186  
    2626)
    2727{
    28   int              i = 0;
     28  register int i = 0;
    2929  IMFS_token_types  type = IMFS_NAME;
     30  register char c;
    3031
    3132  /*
    3233   *  Copy a name into token.  (Remember NULL is a token.)
    3334   */
     35  c = path[i];
     36  while ( (!IMFS_is_separator(c)) && (i <= IMFS_NAME_MAX) ) {
    3437
    35   while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
    36 
    37      token[i] = path[i];
     38     token[i] = c;
    3839
    3940     if (i == IMFS_NAME_MAX)
    4041       return IMFS_INVALID_TOKEN;
    4142
    42      if ( !IMFS_is_valid_name_char( token[i] ) )
     43     if ( !IMFS_is_valid_name_char(c) )
    4344       type = IMFS_INVALID_TOKEN;   
    4445
    45      i++;
     46     c = path [++i];
    4647  }
    4748
     
    5152
    5253  if ( i == 0 ) {
    53     token[i] = path[i];
     54    token[i] = c;
    5455
    5556    if ( token[i] != '\0' ) {
  • c/src/libfs/src/imfs/imfs_gtkn.c

    r04df848 r1e57186  
    2626)
    2727{
    28   int              i = 0;
     28  register int i = 0;
    2929  IMFS_token_types  type = IMFS_NAME;
     30  register char c;
    3031
    3132  /*
    3233   *  Copy a name into token.  (Remember NULL is a token.)
    3334   */
     35  c = path[i];
     36  while ( (!IMFS_is_separator(c)) && (i <= IMFS_NAME_MAX) ) {
    3437
    35   while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
    36 
    37      token[i] = path[i];
     38     token[i] = c;
    3839
    3940     if (i == IMFS_NAME_MAX)
    4041       return IMFS_INVALID_TOKEN;
    4142
    42      if ( !IMFS_is_valid_name_char( token[i] ) )
     43     if ( !IMFS_is_valid_name_char(c) )
    4344       type = IMFS_INVALID_TOKEN;   
    4445
    45      i++;
     46     c = path [++i];
    4647  }
    4748
     
    5152
    5253  if ( i == 0 ) {
    53     token[i] = path[i];
     54    token[i] = c;
    5455
    5556    if ( token[i] != '\0' ) {
  • cpukit/libfs/src/imfs/imfs_gtkn.c

    r04df848 r1e57186  
    2626)
    2727{
    28   int              i = 0;
     28  register int i = 0;
    2929  IMFS_token_types  type = IMFS_NAME;
     30  register char c;
    3031
    3132  /*
    3233   *  Copy a name into token.  (Remember NULL is a token.)
    3334   */
     35  c = path[i];
     36  while ( (!IMFS_is_separator(c)) && (i <= IMFS_NAME_MAX) ) {
    3437
    35   while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
    36 
    37      token[i] = path[i];
     38     token[i] = c;
    3839
    3940     if (i == IMFS_NAME_MAX)
    4041       return IMFS_INVALID_TOKEN;
    4142
    42      if ( !IMFS_is_valid_name_char( token[i] ) )
     43     if ( !IMFS_is_valid_name_char(c) )
    4344       type = IMFS_INVALID_TOKEN;   
    4445
    45      i++;
     46     c = path [++i];
    4647  }
    4748
     
    5152
    5253  if ( i == 0 ) {
    53     token[i] = path[i];
     54    token[i] = c;
    5455
    5556    if ( token[i] != '\0' ) {
Note: See TracChangeset for help on using the changeset viewer.