applied Quentin Carbonneaux's user patch
This commit is contained in:
parent
3b5d848cd4
commit
2831ca36c3
10
sic.c
10
sic.c
@ -138,7 +138,8 @@ main(int argc, char *argv[]) {
|
|||||||
const char *user = getenv("USER");
|
const char *user = getenv("USER");
|
||||||
fd_set rd;
|
fd_set rd;
|
||||||
|
|
||||||
strlcpy(nick, user ? user : "unknown", sizeof nick);
|
if (!user) user = "unknown";
|
||||||
|
strlcpy(nick, user, sizeof nick);
|
||||||
for(i = 1; i < argc; i++) {
|
for(i = 1; i < argc; i++) {
|
||||||
c = argv[i][1];
|
c = argv[i][1];
|
||||||
if(argv[i][0] != '-' || argv[i][2])
|
if(argv[i][0] != '-' || argv[i][2])
|
||||||
@ -156,10 +157,13 @@ main(int argc, char *argv[]) {
|
|||||||
case 'k':
|
case 'k':
|
||||||
if(++i < argc) password = argv[i];
|
if(++i < argc) password = argv[i];
|
||||||
break;
|
break;
|
||||||
|
case 'u':
|
||||||
|
if (++i < argc) user = argv[i];
|
||||||
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
eprint("sic-"VERSION", © 2005-2009 Kris Maglione, Anselm R. Garbe, Nico Golde\n");
|
eprint("sic-"VERSION", © 2005-2009 Kris Maglione, Anselm R. Garbe, Nico Golde\n");
|
||||||
default:
|
default:
|
||||||
eprint("usage: sic [-h host] [-p port] [-n nick] [-k keyword] [-v]\n");
|
eprint("usage: sic [-h host] [-p port] [-n nick] [-k keyword] [-u user] [-v]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* init */
|
/* init */
|
||||||
@ -169,7 +173,7 @@ main(int argc, char *argv[]) {
|
|||||||
if(password)
|
if(password)
|
||||||
sout("PASS %s", password);
|
sout("PASS %s", password);
|
||||||
sout("NICK %s", nick);
|
sout("NICK %s", nick);
|
||||||
sout("USER %s localhost %s :%s", nick, host, nick);
|
sout("USER %s localhost %s :%s", user, host, nick);
|
||||||
fflush(srv);
|
fflush(srv);
|
||||||
setbuf(stdout, NULL);
|
setbuf(stdout, NULL);
|
||||||
setbuf(srv, NULL);
|
setbuf(srv, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user