- Timestamp:
- 2006-01-15T15:42:20Z (18 years ago)
- Branches:
- master
- Children:
- 6fda350
- Parents:
- 13caf0a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r13caf0a r74c119d 432 432 433 433 return cmd; 434 } 435 436 char *irc_build_line( char **cmd ) 437 { 438 int i, len; 439 char *s; 440 441 if( cmd[0] == NULL ) 442 return NULL; 443 444 len = 1; 445 for( i = 0; cmd[i]; i ++ ) 446 len += strlen( cmd[i] ) + 1; 447 448 if( strchr( cmd[i-1], ' ' ) != NULL ) 449 len ++; 450 451 s = g_new0( char, len + 1 ); 452 for( i = 0; cmd[i]; i ++ ) 453 { 454 if( cmd[i+1] == NULL && strchr( cmd[i], ' ' ) != NULL ) 455 strcat( s, ":" ); 456 457 strcat( s, cmd[i] ); 458 459 if( cmd[i+1] ) 460 strcat( s, " " ); 461 } 462 strcat( s, "\r\n" ); 463 464 return s; 434 465 } 435 466
Note: See TracChangeset
for help on using the changeset viewer.