diff --git a/install.sh b/install.sh index 73c62ff..c1ad593 100644 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -xe -sudo cp xyntax.h /usr/include/xolatile/xyntax.h -sudo cp xyntax.c /usr/include/xolatile/xyntax.c +cp xyntax.h /usr/include/xolatile/xyntax.h +cp xyntax.c /usr/include/xolatile/xyntax.c exit diff --git a/xyntax.c b/xyntax.c index c87614b..4d00e03 100644 --- a/xyntax.c +++ b/xyntax.c @@ -20,18 +20,6 @@ char * syntax_escape = NULL; int * syntax_colour = NULL; int * syntax_effect = NULL; -static int compare_character_array (char character, char * character_array, int count) { - int i = 0; - - do { - if (character == character_array [i]) { - return (1); - } - } while (++i != count); - - return (0); -} - int syntax_define (int enrange, int derange, char * begin, char * end, char escape, int colour, int effect) { fatal_failure (begin == NULL, "syntax_define: Begin string is null pointer."); fatal_failure (end == NULL, "syntax_define: End string is null pointer."); @@ -74,7 +62,7 @@ int syntax_select (char * string, int * length) { if (syntax_derange [select] == 0) { break; } else { - if (compare_character_array (string [string_length (syntax_begin [select])], syntax_end [select], string_length (syntax_end [select]))) { + if (character_compare_array (string [string_length (syntax_begin [select])], syntax_end [select], string_length (syntax_end [select])) != 0) { break; } }