- static bool out_of_memory = FALSE;
- struct tries *ptr, *savedptr;
- unsigned char *txt = (unsigned char *)str;
-
- if (txt == 0 || *txt == '\0' || out_of_memory || code == 0)
- return;
-
- if ((*tree) != 0) {
- ptr = savedptr = (*tree);
-
- for (;;) {
- unsigned char cmp = *txt;
-
- while (!CMP_TRY(ptr->ch, cmp)
- && ptr->sibling != 0)
- ptr = ptr->sibling;
-
- if (CMP_TRY(ptr->ch, cmp)) {
- if (*(++txt) == '\0') {
- ptr->value = code;
- return;
- }
- if (ptr->child != 0)
- ptr = ptr->child;
- else
- break;
- } else {
- if ((ptr->sibling = typeCalloc(struct tries,1)) == 0) {
- out_of_memory = TRUE;
- return;
- }
-
- savedptr = ptr = ptr->sibling;
- SET_TRY(ptr,txt);
- ptr->value = 0;
-
- break;
- }
- } /* end for (;;) */
- } else { /* (*tree) == 0 :: First sequence to be added */
- savedptr = ptr = (*tree) = typeCalloc(struct tries,1);
-
- if (ptr == 0) {
- out_of_memory = TRUE;
- return;
+ TRIES *ptr, *savedptr;
+ unsigned const char *txt = (unsigned const char *) str;
+
+ T((T_CALLED("_nc_add_to_try(%p, %s, %u)"), *tree, _nc_visbuf(str), code));
+ if (txt == 0 || *txt == '\0' || code == 0)
+ returnCode(ERR);
+
+ if ((*tree) != 0) {
+ ptr = savedptr = (*tree);
+
+ for (;;) {
+ unsigned char cmp = *txt;
+
+ while (!CMP_TRY(ptr->ch, cmp)
+ && ptr->sibling != 0)
+ ptr = ptr->sibling;
+
+ if (CMP_TRY(ptr->ch, cmp)) {
+ if (*(++txt) == '\0') {
+ ptr->value = code;
+ returnCode(OK);
+ }
+ if (ptr->child != 0)
+ ptr = ptr->child;
+ else
+ break;
+ } else {
+ if ((ptr->sibling = typeCalloc(TRIES, 1)) == 0) {
+ returnCode(ERR);