- Timestamp:
- 2006-03-31T17:55:47Z (17 years ago)
- Branches:
- master
- Children:
- 7d31002
- Parents:
- d783e48
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
rd783e48 re27661d 346 346 void irc_process( irc_t *irc ) 347 347 { 348 char **lines, *temp, **cmd ;348 char **lines, *temp, **cmd, *cs; 349 349 int i; 350 350 … … 355 355 for( i = 0; *lines[i] != '\0'; i ++ ) 356 356 { 357 /* [WvG] Because irc_tokenize splits at every newline, the lines[] list 358 should end with an empty string. This is why this actually works. 359 Took me a while to figure out, Maurits. :-P */ 357 360 if( lines[i+1] == NULL ) 358 361 { … … 362 365 i ++; 363 366 break; 364 } 367 } 368 369 if( ( cs = set_getstr( irc, "charset" ) ) ) 370 { 371 char conv[IRC_MAX_LINE+1]; 372 373 conv[IRC_MAX_LINE] = 0; 374 if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) != -1 ) 375 strcpy( lines[i], conv ); 376 } 365 377 366 378 if( ( cmd = irc_parse_line( lines[i] ) ) == NULL ) … … 388 400 } 389 401 402 /* Splits a long string into separate lines. The array is NULL-terminated and, unless the string 403 contains an incomplete line at the end, ends with an empty string. */ 390 404 char **irc_tokenize( char *buffer ) 391 405 { … … 428 442 } 429 443 444 /* Split an IRC-style line into little parts/arguments. */ 430 445 char **irc_parse_line( char *line ) 431 446 { … … 487 502 } 488 503 504 /* Converts such an array back into a command string. Mainly used for the IPC code right now. */ 489 505 char *irc_build_line( char **cmd ) 490 506 {
Note: See TracChangeset
for help on using the changeset viewer.