Lines 156-162
Link Here
|
156 |
#define UCHARAT(p) ((int)*(p)&CHARBITS) |
156 |
#define UCHARAT(p) ((int)*(p)&CHARBITS) |
157 |
#endif |
157 |
#endif |
158 |
|
158 |
|
159 |
#define FAIL(m) { regerror(m); return(NULL); } |
159 |
#define FAIL(m) { my_regerror(m); return(NULL); } |
160 |
#define ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?') |
160 |
#define ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?') |
161 |
|
161 |
|
162 |
/* |
162 |
/* |
Lines 212-218
Link Here
|
212 |
* of the structure of the compiled regexp. |
212 |
* of the structure of the compiled regexp. |
213 |
*/ |
213 |
*/ |
214 |
regexp * |
214 |
regexp * |
215 |
regcomp( const char *exp ) |
215 |
my_regcomp( const char *exp ) |
216 |
{ |
216 |
{ |
217 |
register regexp *r; |
217 |
register regexp *r; |
218 |
register char *scan; |
218 |
register char *scan; |
Lines 791-797
Link Here
|
791 |
- regexec - match a regexp against a string |
791 |
- regexec - match a regexp against a string |
792 |
*/ |
792 |
*/ |
793 |
int |
793 |
int |
794 |
regexec( |
794 |
my_regexec( |
795 |
register regexp *prog, |
795 |
register regexp *prog, |
796 |
register const char *string ) |
796 |
register const char *string ) |
797 |
{ |
797 |
{ |
Lines 799-811
Link Here
|
799 |
|
799 |
|
800 |
/* Be paranoid... */ |
800 |
/* Be paranoid... */ |
801 |
if (prog == NULL || string == NULL) { |
801 |
if (prog == NULL || string == NULL) { |
802 |
regerror("NULL parameter"); |
802 |
my_regerror("NULL parameter"); |
803 |
return(0); |
803 |
return(0); |
804 |
} |
804 |
} |
805 |
|
805 |
|
806 |
/* Check validity of program. */ |
806 |
/* Check validity of program. */ |
807 |
if (UCHARAT(prog->program) != MAGIC) { |
807 |
if (UCHARAT(prog->program) != MAGIC) { |
808 |
regerror("corrupted program"); |
808 |
my_regerror("corrupted program"); |
809 |
return(0); |
809 |
return(0); |
810 |
} |
810 |
} |
811 |
|
811 |
|
Lines 1070-1076
Link Here
|
1070 |
return(1); /* Success! */ |
1070 |
return(1); /* Success! */ |
1071 |
break; |
1071 |
break; |
1072 |
default: |
1072 |
default: |
1073 |
regerror("memory corruption"); |
1073 |
my_regerror("memory corruption"); |
1074 |
return(0); |
1074 |
return(0); |
1075 |
break; |
1075 |
break; |
1076 |
} |
1076 |
} |
Lines 1082-1088
Link Here
|
1082 |
* We get here only if there's trouble -- normally "case END" is |
1082 |
* We get here only if there's trouble -- normally "case END" is |
1083 |
* the terminating point. |
1083 |
* the terminating point. |
1084 |
*/ |
1084 |
*/ |
1085 |
regerror("corrupted pointers"); |
1085 |
my_regerror("corrupted pointers"); |
1086 |
return(0); |
1086 |
return(0); |
1087 |
} |
1087 |
} |
1088 |
|
1088 |
|
Lines 1122-1128
Link Here
|
1122 |
} |
1122 |
} |
1123 |
break; |
1123 |
break; |
1124 |
default: /* Oh dear. Called inappropriately. */ |
1124 |
default: /* Oh dear. Called inappropriately. */ |
1125 |
regerror("internal foulup"); |
1125 |
my_regerror("internal foulup"); |
1126 |
count = 0; /* Best compromise. */ |
1126 |
count = 0; /* Best compromise. */ |
1127 |
break; |
1127 |
break; |
1128 |
} |
1128 |
} |
Lines 1277-1283
Link Here
|
1277 |
p = "WORDZ"; |
1277 |
p = "WORDZ"; |
1278 |
break; |
1278 |
break; |
1279 |
default: |
1279 |
default: |
1280 |
regerror("corrupted opcode"); |
1280 |
my_regerror("corrupted opcode"); |
1281 |
break; |
1281 |
break; |
1282 |
} |
1282 |
} |
1283 |
if (p != NULL) |
1283 |
if (p != NULL) |
Lines 1319-1332
Link Here
|
1319 |
#endif |
1319 |
#endif |
1320 |
|
1320 |
|
1321 |
void |
1321 |
void |
1322 |
regerror( const char *s ) |
1322 |
my_regerror( const char *s ) |
1323 |
{ |
1323 |
{ |
1324 |
printf( "re error %s\n", s ); |
1324 |
printf( "re error %s\n", s ); |
1325 |
} |
1325 |
} |
1326 |
|
1326 |
|
1327 |
/* TNB */ |
1327 |
/* TNB */ |
1328 |
void |
1328 |
void |
1329 |
redone(regexp *re) |
1329 |
my_redone(regexp *re) |
1330 |
{ |
1330 |
{ |
1331 |
if (re) |
1331 |
if (re) |
1332 |
free((char *) re); |
1332 |
free((char *) re); |