Introduction
Introduction Statistics Contact Development Disclaimer Help
changes for ii-1.2 - ii - irc it, simple FIFO based irc client
git clone git://git.suckless.org/ii
Log
Files
Refs
README
LICENSE
---
commit cc58fcc0683cd305858fda6bafdabade5a4cde3e
parent e27930f4cd56aa339d1d975c0cde70a9492c24d6
Author: Nico Golde <[email protected]>
Date: Sat, 23 Jun 2007 13:37:05 +0200
changes for ii-1.2
Diffstat:
M Makefile | 6 +++---
M README | 2 +-
M config.mk | 2 +-
M ii.c | 25 +++++++++++--------------
4 files changed, 16 insertions(+), 19 deletions(-)
---
diff --git a/Makefile b/Makefile
@@ -24,7 +24,7 @@ options:
dist: clean
@mkdir -p ii-${VERSION}
- @cp -R query.sh Makefile README FAQ LICENSE config.mk ii.c ii.1 ii-${V…
+ @cp -R query.sh Makefile CHANGES README FAQ LICENSE config.mk ii.c ii.…
@tar -cf ii-${VERSION}.tar ii-${VERSION}
@gzip ii-${VERSION}.tar
@rm -rf ii-${VERSION}
@@ -40,7 +40,7 @@ install: all
@mkdir -p ${DESTDIR}${MAN1DIR}
@install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MAN1DIR}
- @install -m 644 README query.sh FAQ LICENSE ${DESTDIR}${DOCDIR}
+ @install -m 644 CHANGES README query.sh FAQ LICENSE ${DESTDIR}${DOCDIR}
@install -m 775 ii ${DESTDIR}${BINDIR}
@install -m 444 ii.1 ${DESTDIR}${MAN1DIR}
@echo "installed ii"
@@ -52,4 +52,4 @@ uninstall: all
@echo "uninstalled ii"
clean:
- rm -f ii *~ *.o *core
+ rm -f ii *~ *.o *core *.tar.gz
diff --git a/README b/README
@@ -47,7 +47,7 @@ Changelog
---------
Since I missed the chance to add a proper changelog right from the beginning,
please have a look at the commit messages on http://www.suckless.org/hg.rc/ii
-they are fairly descriptive.
+they are fairly descriptive on releases prior to 1.2.
Contact
-------
diff --git a/config.mk b/config.mk
@@ -12,7 +12,7 @@ DESTDIR =
INCDIR = ${PREFIX}/include
LIBDIR = ${PREFIX}/lib
-VERSION = 1.1
+VERSION = 1.2
# includes and libs
INCLUDES = -I. -I${INCDIR} -I/usr/include
diff --git a/ii.c b/ii.c
@@ -53,7 +53,7 @@ static void usage() {
exit(EXIT_SUCCESS);
}
static char *lower(char *s) {
- char *p;
+ char *p = NULL;
for(p = s; p && *p; p++) *p = tolower(*p);
return s;
}
@@ -120,8 +120,7 @@ static void add_channel(char *name) {
perror("ii: cannot allocate memory");
exit(EXIT_FAILURE);
}
- if(!channels)
- channels = c;
+ if(!channels) channels = c;
else {
c->next = channels;
channels = c;
@@ -132,8 +131,7 @@ static void add_channel(char *name) {
static void rm_channel(Channel *c) {
Channel *p;
- if(channels == c)
- channels = channels->next;
+ if(channels == c) channels = channels->next;
else {
for(p = channels; p && p->next != c; p = p->next);
if(p->next == c)
@@ -144,13 +142,12 @@ static void rm_channel(Channel *c) {
}
static void login(char *key, char *fullname) {
- if(key)
- snprintf(message, PIPE_BUF,
+ if(key) snprintf(message, PIPE_BUF,
"PASS %s\r\nNICK %s\r\nUSER %s localhost %s :%…
nick, nick, host, fullname ? fullname : nick);
- else
- snprintf(message, PIPE_BUF, "NICK %s\r\nUSER %s localhost %s :…
+ else snprintf(message, PIPE_BUF, "NICK %s\r\nUSER %s localhost %s :%s\…
nick, nick, host, fullname ? fullname : nick);
+
write(irc, message, strlen(message)); /* login */
}
@@ -179,7 +176,7 @@ static int tcpopen(unsigned short port) {
}
static size_t tokenize(char **result, size_t reslen, char *str, char delim) {
- char *p, *n;
+ char *p = NULL, *n = NULL;
size_t i;
if(!str)
@@ -202,8 +199,7 @@ static size_t tokenize(char **result, size_t reslen, char *…
return i; /* number of tokens */
}
-static void print_out(char *channel, char *buf)
-{
+static void print_out(char *channel, char *buf) {
static char outfile[256];
FILE *out;
static char buft[18];
@@ -211,6 +207,7 @@ static void print_out(char *channel, char *buf)
create_filepath(outfile, sizeof(outfile), channel, "out");
if(!(out = fopen(outfile, "a"))) return;
+
strftime(buft, sizeof(buft), "%F %R", localtime(&t));
fprintf(out, "%s %s\n", buft, buf);
fclose(out);
@@ -237,7 +234,7 @@ static void proc_channels_input(Channel *c, char *buf) {
p = strchr(&buf[3], ' ');
if(p) *p = 0;
if((buf[3]=='#')||(buf[3]=='&')||(buf[3]=='+')||(buf[3…
- if(p) snprintf(message, PIPE_BUF, "JOIN %s %s\…
+ if(p) snprintf(message, PIPE_BUF, "JOIN %s %s\…
else snprintf(message, PIPE_BUF, "JOIN %s\r\n"…
add_channel(&buf[3]);
}
@@ -275,7 +272,7 @@ static void proc_channels_input(Channel *c, char *buf) {
snprintf(message, PIPE_BUF, "PART %s :%s\r\n",…
else
snprintf(message, PIPE_BUF,
- "PART %s :ii - 500 LOC are too…
+ "PART %s :ii - 500 SLOC are to…
write(irc, message, strlen(message));
close(c->fd);
create_filepath(infile, sizeof(infile), c->name, "in");
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.