@@ -30,9 +30,9 @@ static char * olog = NULL; /* log irc stream parh */
30
30
31
31
/* append string to specified file path */
32
32
static void
33
- append_to_file (char * str ) {
34
- FILE * out = fopen (olog , "a" );
35
- fprintf (out , "%s" , str );
33
+ printa (char * str ) {
34
+ FILE * out = fopen (olog , "a" );
35
+ fprintf (out , "%s" , str );
36
36
fclose (out );
37
37
}
38
38
@@ -85,7 +85,7 @@ raw(char *cmd_str, char *fmt, ...) {
85
85
va_end (ap );
86
86
87
87
if (verb ) printf ("<< %s" , cmd_str );
88
- if (olog ) append_to_file (cmd_str );
88
+ if (olog ) printa (cmd_str );
89
89
90
90
write (conn , cmd_str , strlen (cmd_str ));
91
91
}
@@ -125,6 +125,8 @@ printw(const char *format, ...) {
125
125
vsnprintf (line , IRC_MSG_MAX + 1 , format , argptr );
126
126
va_end (argptr );
127
127
128
+ if (olog ) printa (line );
129
+
128
130
for (i = 0 ; isspace (line [i ]); i ++ ) printf ("%c" , line [i ]);
129
131
130
132
spaceleft = cmax + gutl - (i - 1 );
@@ -159,7 +161,6 @@ parser(int sl, char *s) {
159
161
o = -1 ;
160
162
161
163
if (verb ) printf (">> %s" , buf_c );
162
- if (olog ) append_to_file (buf_c );
163
164
164
165
if (!strncmp (buf_c , "PING" , 4 )) {
165
166
buf_c [1 ] = 'O' ;
0 commit comments