diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-config.c | 2 | ||||
-rw-r--r-- | src/core/wee-network.c | 4 | ||||
-rw-r--r-- | src/core/wee-string.c | 70 |
3 files changed, 38 insertions, 38 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 1816ed8d8..f63fac17c 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -224,7 +224,7 @@ config_change_title (void *data, struct t_config_option *option) (void) option; if (CONFIG_BOOLEAN(config_look_set_title)) - gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION); + gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION); } /* diff --git a/src/core/wee-network.c b/src/core/wee-network.c index 1f422fcdd..60cf65521 100644 --- a/src/core/wee-network.c +++ b/src/core/wee-network.c @@ -614,8 +614,8 @@ network_connect_child (struct t_hook *hook_connect) freeaddrinfo (res); return; } - - status_str[0] = '0' + WEECHAT_HOOK_CONNECT_OK; + + status_str[0] = '0' + WEECHAT_HOOK_CONNECT_OK; } else { diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 7944486e1..c13d63294 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -940,65 +940,65 @@ string_split_command (const char *command, char separator) const char *ptr; if (!command || !command[0]) - return NULL; + return NULL; nb_substr = 1; ptr = command; while ( (p = strchr(ptr, separator)) != NULL) { - nb_substr++; - ptr = ++p; + nb_substr++; + ptr = ++p; } array = malloc ((nb_substr + 1) * sizeof (array[0])); if (!array) - return NULL; + return NULL; buffer = malloc (strlen(command) + 1); if (!buffer) { - free (array); - return NULL; + free (array); + return NULL; } ptr = command; str_idx = 0; arr_idx = 0; - while(*ptr != '\0') - { - type = 0; - if (*ptr == ';') - { - if (ptr == command) - type = 1; - else if ( *(ptr-1) != '\\') - type = 1; - else if ( *(ptr-1) == '\\') - type = 2; - } - if (type == 1) - { - buffer[str_idx] = '\0'; - str_idx = -1; - p = buffer; - /* strip white spaces a the begining of the line */ - while (*p == ' ') p++; - if (p && p[0]) - array[arr_idx++] = strdup (p); - } - else if (type == 2) - buffer[--str_idx] = *ptr; - else - buffer[str_idx] = *ptr; - str_idx++; - ptr++; + while(*ptr != '\0') + { + type = 0; + if (*ptr == ';') + { + if (ptr == command) + type = 1; + else if ( *(ptr-1) != '\\') + type = 1; + else if ( *(ptr-1) == '\\') + type = 2; + } + if (type == 1) + { + buffer[str_idx] = '\0'; + str_idx = -1; + p = buffer; + /* strip white spaces a the begining of the line */ + while (*p == ' ') p++; + if (p && p[0]) + array[arr_idx++] = strdup (p); + } + else if (type == 2) + buffer[--str_idx] = *ptr; + else + buffer[str_idx] = *ptr; + str_idx++; + ptr++; } buffer[str_idx] = '\0'; p = buffer; while (*p == ' ') p++; if (p && p[0]) - array[arr_idx++] = strdup (p); + array[arr_idx++] = strdup (p); array[arr_idx] = NULL; |