Nada más que decir, ¡GENIO! muchas gracias!
Edito, probe, estudie un poco sobre los arrays multidimensionales, los probe en varias cosas y me funcionaron. Pero aquí, al parecer no, a ver si me puedes decir en donde me he equivocado, y disculpa el abuso.
Código C:
Ver originalchar *depends_parser(FILE *pkgfile_dir)
{
char character, last_character = '0', *string_depends = NULL, **depends_alone = NULL, *depends_p;
int character_count = 0, memory_count = 1, memory_count2 = 1, position_check = 0;
depends_alone
= (char **) malloc(sizeof(char *)*memory_count2
);
while ((character
= getc(pkgfile_dir
)) != EOF
) {
if (character == '\n')
{
if ((strstr(string_depends
, "Depends on:"))) {
string_depends[character_count] = '\0';
depends_p = string_depends;
character_count = 0;
memory_count = 1;
while (*depends_p != '\0')
{
if (*depends_p == ':')
{
position_check = 1;
depends_p++;
else
{
depends_p--;
}
}
else if (position_check == 1)
{
if (*depends_p == ' ')
{
memory_count2++;
depends_alone
= (char **) realloc(depends_alone
, sizeof(char *)*memory_count2
);
character_count = 0;
memory_count = 1;
}
{
depends_alone
[memory_count2
] = (char *) realloc(depends_alone
[memory_count2
], sizeof(char)*memory_count
); depends_alone[memory_count2][character_count] = *depends_p;
character_count++;
memory_count++;
}
}
depends_p++;
}
break;
}
else
{
character_count = 0;
memory_count = 1;
}
}
else
{
string_depends
= (char *) realloc(string_depends
, memory_count
); string_depends[character_count] = character;
character_count++;
memory_count++;
}
}
//puts(depends_alone[0]);
if (string_depends)
}