1
1
Этот коммит содержится в:
Miguel de Icaza 1999-10-19 04:21:26 +00:00
родитель d8a0004bc7
Коммит fec68ab026
2 изменённых файлов: 12 добавлений и 17 удалений

Просмотреть файл

@ -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