- Timestamp:
- 2014-07-24T03:51:07Z (10 years ago)
- Branches:
- master
- Children:
- 59e66ff
- Parents:
- 1783ab6
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/misc.c
r1783ab6 r269580c 682 682 white\ space in 'various ways'. Returns a NULL-terminated static 683 683 char** so watch out with nested use! Definitely not thread-safe. */ 684 char **split_command_parts( char *command )684 char **split_command_parts( char *command, int limit ) 685 685 { 686 686 static char *cmd[IRC_MAX_ARGS+1]; … … 692 692 k = 1; 693 693 for( s = command; *s && k < IRC_MAX_ARGS; s ++ ) 694 { 694 695 if( *s == ' ' && !q ) 695 696 { 696 697 *s = 0; 697 698 while( *++s == ' ' ); 698 if( *s == '"' || *s == '\'')699 if( k != limit && (*s == '"' || *s == '\'') ) 699 700 { 700 701 q = *s; … … 704 705 { 705 706 cmd[k++] = s; 707 if (limit && k > limit) { 708 break; 709 } 706 710 s --; 707 711 } … … 722 726 q = *s = 0; 723 727 } 728 } 724 729 725 730 /* Full zero-padding for easier argc checking. */ -
lib/misc.h
r1783ab6 r269580c 67 67 G_MODULE_EXPORT gboolean ssl_sockerr_again( void *ssl ); 68 68 G_MODULE_EXPORT int md5_verify_password( char *password, char *hash ); 69 G_MODULE_EXPORT char **split_command_parts( char *command );69 G_MODULE_EXPORT char **split_command_parts( char *command, int limit ); 70 70 G_MODULE_EXPORT char *get_rfc822_header( const char *text, const char *header, int len ); 71 71
Note: See TracChangeset
for help on using the changeset viewer.