Convert sindex() and rsindex() to use const char * arguments
Also simply sindex() considerably using standard strspn() / strcspn() functions.
This commit is contained in:
@@ -28,8 +28,8 @@ char * BX_last_arg (char **);
|
||||
char * BX_expand_twiddle (char *);
|
||||
char * BX_upper (char *);
|
||||
char * BX_lower (char *);
|
||||
char * BX_sindex (register char *, char *);
|
||||
char * BX_rsindex (register char *, char *, char *, int);
|
||||
char * BX_sindex (const char *, const char *);
|
||||
char * BX_rsindex (const char *, const char *, const char *, int);
|
||||
char * BX_path_search (char *, char *);
|
||||
char * BX_double_quote (const char *, const char *, char *);
|
||||
|
||||
|
||||
@@ -145,8 +145,8 @@ extern Function_ptr *global;
|
||||
#define remove_trailing_spaces (*(char * (*)(char *))global[REMOVE_TRAILING_SPACES])
|
||||
#define expand_twiddle (*(char * (*)(char *))global[EXPAND_TWIDDLE])
|
||||
#define check_nickname (*(char * (*)(char *))global[CHECK_NICKNAME])
|
||||
#define sindex (*(char * (*)(char *, char *))global[SINDEX])
|
||||
#define rsindex (*(char * (*)(char *, char *, char *, int))global[RSINDEX])
|
||||
#define sindex (*(char * (*)(const char *, const char *))global[SINDEX])
|
||||
#define rsindex (*(char * (*)(const char *, const char *, const char *, int))global[RSINDEX])
|
||||
#define is_number (*(int (*)(const char *))global[ISNUMBER])
|
||||
#define rfgets (*(char * (*)(char *, int , FILE *))global[RFGETS])
|
||||
#define path_search (*(char * (*)(char *, char *))global[PATH_SEARCH])
|
||||
|
||||
Reference in New Issue
Block a user