parse uicb command with no arguments and no tailing space
This commit is contained in:
parent
fefa16611a
commit
1de87e372d
12
uicb.c
12
uicb.c
|
@ -48,9 +48,10 @@ parse_control(char *cmd, awesome_config *awesomeconf)
|
||||||
int
|
int
|
||||||
run_uicb(char *cmd, awesome_config *awesomeconf)
|
run_uicb(char *cmd, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
char *p, *uicb_name, *arg;
|
char *p, *uicb_name;
|
||||||
|
const char *arg;
|
||||||
int screen;
|
int screen;
|
||||||
void (*uicb) (awesome_config *, char *);
|
void (*uicb) (awesome_config *, const char *);
|
||||||
|
|
||||||
if(!a_strlen(cmd))
|
if(!a_strlen(cmd))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -66,11 +67,12 @@ run_uicb(char *cmd, awesome_config *awesomeconf)
|
||||||
uicb_name = p;
|
uicb_name = p;
|
||||||
|
|
||||||
if(!(p = strchr(p, ' ')))
|
if(!(p = strchr(p, ' ')))
|
||||||
return -1;
|
arg = "";
|
||||||
|
else
|
||||||
|
{
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
|
|
||||||
arg = p;
|
arg = p;
|
||||||
|
}
|
||||||
|
|
||||||
if((p = strchr(arg, '\n')))
|
if((p = strchr(arg, '\n')))
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
Loading…
Reference in New Issue