Patch from sav@bcs.zp.ua to const-correct
Этот коммит содержится в:
родитель
d8a0004bc7
Коммит
fec68ab026
23
src/user.c
23
src/user.c
@ -81,9 +81,9 @@ extern char *search_string (char *, char *);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Returns how many characters we should advance if %view was found */
|
/* Returns how many characters we should advance if %view was found */
|
||||||
int check_format_view (char *p)
|
int check_format_view (const char *p)
|
||||||
{
|
{
|
||||||
char *q = p;
|
const char *q = p;
|
||||||
if (!strncmp (p, "view", 4)){
|
if (!strncmp (p, "view", 4)){
|
||||||
q += 4;
|
q += 4;
|
||||||
if (*q == '{'){
|
if (*q == '{'){
|
||||||
@ -106,35 +106,30 @@ int check_format_view (char *p)
|
|||||||
q++;
|
q++;
|
||||||
}
|
}
|
||||||
return q - p;
|
return q - p;
|
||||||
} else
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int check_format_cd (char *p)
|
int check_format_cd (const char *p)
|
||||||
{
|
{
|
||||||
if (!strncmp (p, "cd", 2))
|
return (strncmp (p, "cd", 2)) ? 0 : 3;
|
||||||
return 3;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if p has a "^var\{var-name\}" */
|
/* Check if p has a "^var\{var-name\}" */
|
||||||
/* Returns the number of skipped characters (zero on not found) */
|
/* Returns the number of skipped characters (zero on not found) */
|
||||||
/* V will be set to the expanded variable name */
|
/* V will be set to the expanded variable name */
|
||||||
int check_format_var (char *p, char **v)
|
int check_format_var (const char *p, char **v)
|
||||||
{
|
{
|
||||||
char *q = p;
|
const char *q = p;
|
||||||
char *var_name;
|
char *var_name;
|
||||||
char *value;
|
char *value;
|
||||||
char *dots;
|
const char *dots = 0;
|
||||||
|
|
||||||
*v = 0;
|
*v = 0;
|
||||||
dots = 0;
|
|
||||||
if (!strncmp (p, "var{", 4)){
|
if (!strncmp (p, "var{", 4)){
|
||||||
for (q += 4; *q && *q != '}'; q++){
|
for (q += 4; *q && *q != '}'; q++){
|
||||||
if (*q == ':')
|
if (*q == ':')
|
||||||
dots = q+1;
|
dots = q+1;
|
||||||
;
|
|
||||||
}
|
}
|
||||||
if (!*q)
|
if (!*q)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
void user_menu_cmd (void);
|
void user_menu_cmd (void);
|
||||||
char *expand_format (char, int);
|
char *expand_format (char, int);
|
||||||
int check_format_view (char *);
|
int check_format_view (const char *);
|
||||||
int check_format_var (char *p, char **v);
|
int check_format_var (const char *, char **);
|
||||||
int check_format_cd (char *);
|
int check_format_cd (const char *);
|
||||||
char *check_patterns (char*);
|
char *check_patterns (char*);
|
||||||
|
|
||||||
#ifdef OS2_NT
|
#ifdef OS2_NT
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user