compat/regex: fix spelling and grammar in comments

Some of these were found using Lucas De Marchi's codespell tool. Others noticed by Eric Sunshine. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefano Lattarini committed Apr 12, 2013 at 00:36 UTC ce9171cd63dc64bd6cfcbb09df630774b2b2a99c
3 files changed +6 -6
compat/regex/regcomp.c
+2 -2
@@ -2095,7 +2095,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
2095
2096 /* Entry point of the parser.
2097 Parse the regular expression REGEXP and return the structure tree.
2098 - If an error is occured, ERR is set by error code, and return NULL.
2098 + If an error has occurred, ERR is set by error code, and return NULL.
2099 This function build the following tree, from regular expression <reg_exp>:
2100 CAT
2101 / \
@@ -3715,7 +3715,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
3715 /* This is intended for the expressions like "a{1,3}".
3716 Fetch a number from `input', and return the number.
3717 Return -1, if the number field is empty like "{,1}".
3718 - Return -2, If an error is occured. */
3718 + Return -2, if an error has occurred. */
3719
3720 static int
3721 fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax)
compat/regex/regex.c
+1 -1
@@ -22,7 +22,7 @@
22 #include "config.h"
23 #endif
24
25 -/* Make sure noone compiles this code with a C++ compiler. */
25 +/* Make sure no one compiles this code with a C++ compiler. */
26 #ifdef __cplusplus
27 # error "This is C code, use a C compiler"
28 #endif
compat/regex/regex_internal.c
+3 -3
@@ -1284,7 +1284,7 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src)
1284
1285 /* Insert the new element ELEM to the re_node_set* SET.
1286 SET should not already have ELEM.
1287 - return -1 if an error is occured, return 1 otherwise. */
1287 + return -1 if an error has occurred, return 1 otherwise. */
1288
1289 static int
1290 internal_function
@@ -1341,7 +1341,7 @@ re_node_set_insert (re_node_set *set, int elem)
1341
1342 /* Insert the new element ELEM to the re_node_set* SET.
1343 SET should not already have any element greater than or equal to ELEM.
1344 - Return -1 if an error is occured, return 1 otherwise. */
1344 + Return -1 if an error has occurred, return 1 otherwise. */
1345
1346 static int
1347 internal_function
@@ -1416,7 +1416,7 @@ re_node_set_remove_at (re_node_set *set, int idx)
1416
1417
1418 /* Add the token TOKEN to dfa->nodes, and return the index of the token.
1419 - Or return -1, if an error will be occured. */
1419 + Or return -1, if an error has occurred. */
1420
1421 static int
1422 internal_function