mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Check ignore windowname for truncation and provide user feedback during
config parse; based on a discussion with Tiago Cunha.
This commit is contained in:
parent
df15337a9f
commit
c28467cda5
2
calmwm.h
2
calmwm.h
@ -528,7 +528,7 @@ void conf_cursor(struct conf *);
|
|||||||
void conf_grab_kbd(Window);
|
void conf_grab_kbd(Window);
|
||||||
void conf_grab_mouse(Window);
|
void conf_grab_mouse(Window);
|
||||||
void conf_init(struct conf *);
|
void conf_init(struct conf *);
|
||||||
void conf_ignore(struct conf *, const char *);
|
int conf_ignore(struct conf *, const char *);
|
||||||
void conf_screen(struct screen_ctx *);
|
void conf_screen(struct screen_ctx *);
|
||||||
|
|
||||||
void xev_process(void);
|
void xev_process(void);
|
||||||
|
6
conf.c
6
conf.c
@ -73,16 +73,18 @@ conf_autogroup(struct conf *c, int no, const char *val)
|
|||||||
TAILQ_INSERT_TAIL(&c->autogroupq, aw, entry);
|
TAILQ_INSERT_TAIL(&c->autogroupq, aw, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
conf_ignore(struct conf *c, const char *val)
|
conf_ignore(struct conf *c, const char *val)
|
||||||
{
|
{
|
||||||
struct winmatch *wm;
|
struct winmatch *wm;
|
||||||
|
|
||||||
wm = xcalloc(1, sizeof(*wm));
|
wm = xcalloc(1, sizeof(*wm));
|
||||||
|
|
||||||
(void)strlcpy(wm->title, val, sizeof(wm->title));
|
if (strlcpy(wm->title, val, sizeof(wm->title)) >= sizeof(wm->title))
|
||||||
|
return (0);
|
||||||
|
|
||||||
TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry);
|
TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry);
|
||||||
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *color_binds[] = {
|
static const char *color_binds[] = {
|
||||||
|
6
parse.y
6
parse.y
@ -151,7 +151,11 @@ main : FONTNAME STRING {
|
|||||||
free($3);
|
free($3);
|
||||||
}
|
}
|
||||||
| IGNORE STRING {
|
| IGNORE STRING {
|
||||||
conf_ignore(conf, $2);
|
if (!conf_ignore(conf, $2)) {
|
||||||
|
yyerror("ignore windowname too long");
|
||||||
|
free($2);
|
||||||
|
YYERROR;
|
||||||
|
}
|
||||||
free($2);
|
free($2);
|
||||||
}
|
}
|
||||||
| BIND STRING string {
|
| BIND STRING string {
|
||||||
|
Loading…
Reference in New Issue
Block a user