[hackers] [ii] changes for ii-1.2

From: Nico Golde <nion_AT_suckless.org>
Date: Sat Jun 23 13:42:31 2007

changeset: 68:0391602b2f06
user: Nico Golde <nion_AT_suckless.org>
date: Sat Jun 23 13:37:05 2007 +0200
summary: changes for ii-1.2

diff -r 298ccf9d59bc -r 0391602b2f06 Makefile
--- a/Makefile Fri Jun 22 13:45:57 2007 +0200
+++ b/Makefile Sat Jun 23 13:37:05 2007 +0200
@@ -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-${VERSION}
+ @cp -R query.sh Makefile CHANGES README FAQ LICENSE config.mk ii.c ii.1 ii-${VERSION}
         @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 -r 298ccf9d59bc -r 0391602b2f06 README
--- a/README Fri Jun 22 13:45:57 2007 +0200
+++ b/README Sat Jun 23 13:37:05 2007 +0200
@@ -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 -r 298ccf9d59bc -r 0391602b2f06 config.mk
--- a/config.mk Fri Jun 22 13:45:57 2007 +0200
+++ b/config.mk Sat Jun 23 13:37:05 2007 +0200
@@ -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 -r 298ccf9d59bc -r 0391602b2f06 ii.c
--- a/ii.c Fri Jun 22 13:45:57 2007 +0200
+++ b/ii.c Sat Jun 23 13:37:05 2007 +0200
@@ -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 :%s\r\n", key,
                                 nick, nick, host, fullname ? fullname : nick);
- else
- snprintf(message, PIPE_BUF, "NICK %s\r\nUSER %s localhost %s :%s\r\n",
+ else snprintf(message, PIPE_BUF, "NICK %s\r\nUSER %s localhost %s :%s\r\n",
                                 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, si
         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, cha
 
         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
                         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\r\n", &buf[3], p + 1);
+ if(p) snprintf(message, PIPE_BUF, "JOIN %s %s\r\n", &buf[3], p + 1); /* password protected channel */
                                 else snprintf(message, PIPE_BUF, "JOIN %s\r\n", &buf[3]);
                                 add_channel(&buf[3]);
                         }
@@ -275,7 +272,7 @@ static void proc_channels_input(Channel
                                 snprintf(message, PIPE_BUF, "PART %s :%s\r\n", c->name, &buf[3]);
                         else
                                 snprintf(message, PIPE_BUF,
- "PART %s :ii - 500 LOC are too much\r\n", c->name);
+ "PART %s :ii - 500 SLOC are too much\r\n", c->name);
                         write(irc, message, strlen(message));
                         close(c->fd);
                         create_filepath(infile, sizeof(infile), c->name, "in");
Received on Sat Jun 23 2007 - 13:42:31 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:21 UTC