1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 00:03:12 +02:00

Remove evil tabs in sources

This commit is contained in:
Sebastien Helleu
2010-01-24 10:47:53 +01:00
parent 309e8eadab
commit eb56a98fc8
28 changed files with 484 additions and 485 deletions
+35 -35
View File
@@ -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;