Patch from sav@bcs.zp.ua to const-correct

This commit is contained in:
Miguel de Icaza 1999-10-19 04:21:26 +00:00
parent d8a0004bc7
commit fec68ab026
2 changed files with 12 additions and 17 deletions

View File

@ -81,9 +81,9 @@ extern char *search_string (char *, char *);
*/
/* 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)){
q += 4;
if (*q == '{'){
@ -106,35 +106,30 @@ int check_format_view (char *p)
q++;
}
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 3;
else
return 0;
return (strncmp (p, "cd", 2)) ? 0 : 3;
}
/* Check if p has a "^var\{var-name\}" */
/* Returns the number of skipped characters (zero on not found) */
/* 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 *value;
char *dots;
const char *dots = 0;
*v = 0;
dots = 0;
if (!strncmp (p, "var{", 4)){
for (q += 4; *q && *q != '}'; q++){
if (*q == ':')
dots = q+1;
;
}
if (!*q)
return 0;

View File

@ -3,9 +3,9 @@
void user_menu_cmd (void);
char *expand_format (char, int);
int check_format_view (char *);
int check_format_var (char *p, char **v);
int check_format_cd (char *);
int check_format_view (const char *);
int check_format_var (const char *, char **);
int check_format_cd (const char *);
char *check_patterns (char*);
#ifdef OS2_NT