|
|
@@ -573,31 +573,25 @@ int character_compare_array (char character, char * character_array) { |
|
|
|
return (0); |
|
|
|
} |
|
|
|
|
|
|
|
int character_count (char * string, int from, int to, char this, char stop) { |
|
|
|
int character_count (char * string, char this, int from, int to, char stop) { |
|
|
|
int count; |
|
|
|
|
|
|
|
for (count = 0; (from != to) && (string [from] != stop); from += (int) ((to < from) ? -1 : 1)) { |
|
|
|
count += (int) ((string [from] == this) || (this == '\0')); |
|
|
|
} |
|
|
|
/* |
|
|
|
if (to < from) { |
|
|
|
for (count = 0; to < from; --from) { |
|
|
|
if ((string [from] == this) || (this == '\0')) { |
|
|
|
++count; |
|
|
|
} |
|
|
|
if (string [from] == stop) { |
|
|
|
break; |
|
|
|
} |
|
|
|
for (count = 0; (to < from) && (string [from] != stop); --from) { |
|
|
|
count += (int) ((string [from] == this) || (this == '\0')); |
|
|
|
} |
|
|
|
} else if (from < to) { |
|
|
|
for (count = 0; from < to; ++from) { |
|
|
|
if (string [from] == this) { |
|
|
|
++count; |
|
|
|
} |
|
|
|
if (string [from] == stop) { |
|
|
|
break; |
|
|
|
} |
|
|
|
for (count = 0; (from < to) && (string [from] != stop); ++from) { |
|
|
|
count += (int) ((string [from] == this) || (this == '\0')); |
|
|
|
} |
|
|
|
} else { |
|
|
|
count = 0; |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
return (count); |
|
|
|
} |
|
|
|
|
|
|
|