mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
* user.c (check_patterns): Ignore invalid shell_patterns and
let user see them in the menu. The error message was too vague.
This commit is contained in:
parent
da7e82d253
commit
cf31b0aacd
@ -1,3 +1,8 @@
|
|||||||
|
2002-09-26 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* user.c (check_patterns): Ignore invalid shell_patterns and
|
||||||
|
let user see them in the menu. The error message was too vague.
|
||||||
|
|
||||||
2002-09-26 Andrew V. Samoilov <sav@bcs.zp.ua>
|
2002-09-26 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||||
|
|
||||||
* util.c (mc_mkstemps): Really return NULL in the filename in the
|
* util.c (mc_mkstemps): Really return NULL in the filename in the
|
||||||
|
31
src/user.c
31
src/user.c
@ -266,23 +266,30 @@ expand_format (WEdit * edit_widget, char c, int quote)
|
|||||||
return g_strdup ("");
|
return g_strdup ("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks for shell patterns definition */
|
/*
|
||||||
|
* Check for the "shell_patterns" directive. If it's found and valid,
|
||||||
|
* interpret it and move the pointer past the directive. Return the
|
||||||
|
* current pointer.
|
||||||
|
*/
|
||||||
static char *
|
static char *
|
||||||
check_patterns (char *p)
|
check_patterns (char *p)
|
||||||
{
|
{
|
||||||
static const char def_name[] = "shell_patterns=";
|
static const char def_name[] = "shell_patterns=";
|
||||||
int value;
|
char *p0 = p;
|
||||||
|
|
||||||
if (strncmp (p, def_name, sizeof (def_name) - 1) == 0) {
|
if (strncmp (p, def_name, sizeof (def_name) - 1) != 0)
|
||||||
p += sizeof (def_name) - 1;
|
return p0;
|
||||||
value = *p++ - '0';
|
|
||||||
if (value == 0 || value == 1)
|
p += sizeof (def_name) - 1;
|
||||||
easy_patterns = value;
|
if (*p == '1')
|
||||||
else
|
easy_patterns = 1;
|
||||||
message (1, MSG_ERROR,
|
else if (*p == '0')
|
||||||
_(" Invalid shell pattern definition \"%c\". "),
|
easy_patterns = 0;
|
||||||
value + '0');
|
else
|
||||||
}
|
return p0;
|
||||||
|
|
||||||
|
/* Skip spaces */
|
||||||
|
p++;
|
||||||
while (*p == '\n' || *p == '\t' || *p == ' ')
|
while (*p == '\n' || *p == '\t' || *p == ' ')
|
||||||
p++;
|
p++;
|
||||||
return p;
|
return p;
|
||||||
|
Loading…
Reference in New Issue
Block a user