FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/low_level.c
/* Convert the C string in *TEXT to a revision number and return it in *REV.
 * Overflows, negative values other than -1 and terminating characters other
 * than 0x20 or 0x0 will cause an error.  Set *TEXT to the first char after
 * the initial separator or to EOS.
 */
Convert the C string in *TEXT to a revision number and return it in *REV.
Overflows, negative values other than -1 and terminating characters other
than 0x20 or 0x0 will cause an error.  Set *TEXT to the first char after
the initial separator or to EOS.
Convert the C string in * TEXT to a revision number and return it in * REV . Overflows negative values other than - 1 and terminating characters other than 0x20 or 0x0 will cause an error . Set * TEXT to the first char after the initial separator or to EOS .
static svn_error_t *
parse_revnum(svn_revnum_t *rev,
             const char **text)
{
  const char *string = *text;
  if ((string[0] == '-') && (string[1] == '1'))
    {
      *rev = SVN_INVALID_REVNUM;
      string += 2;
    }
  else
    {
      SVN_ERR(svn_revnum_parse(rev, string, &string));
    }
  if (*string == ' ')
    ++string;
  else if (*string != '\0')
    return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
                            _("Invalid character in revision number"));
  *text = string;
  return SVN_NO_ERROR;
}
static svn_error_t * parse_revnum ( svn_revnum_t * rev , const char * * text ) { const char * string = * text ; if ( ( string [ 0 ] == ' ' ) && ( string [ 1 ] == ' ' ) ) { * rev = SVN_INVALID_REVNUM ; string += 2 ; } else { SVN_ERR ( svn_revnum_parse ( rev , string , & string ) ) ; } if ( * string == ' ' ) ++ string ; else if ( * string != ' \0 ' ) return svn_error_create ( SVN_ERR_FS_CORRUPT , NULL , _ ( " " ) ) ; * text = string ; return SVN_NO_ERROR ; }
Convert the C string in *TEXT to a revision number and return it in *REV.
Convert the C string in * TEXT to a revision number and return it in * REV .