diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-01-12 17:36:47 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-01-12 17:36:47 +0000 |
commit | 765df2c46b9dd8b9d2cd949fea547d8089ba588f (patch) | |
tree | 44ec4de9ce427c0a55bed6025055be57aeb45258 | |
parent | 43dd45d037e060f41e7a6258b8a89a1037e255dc (diff) | |
download | pcre-765df2c46b9dd8b9d2cd949fea547d8089ba588f.tar.gz |
Move definition of pcregrep_exit() above its first reference; this applies only
to Windows.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@586 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | pcregrep.c | 49 |
2 files changed, 29 insertions, 25 deletions
@@ -16,6 +16,11 @@ Version 8.12 12-Jan-2011 did strange things, either producing crazy output, or crashing. It should, of course, ignore a request for colour when reporting lines that do not match. + +4. If pcregrep was compiled under Windows, there was a reference to the + function pcregrep_exit() before it was defined. I am assuming this was + the cause of the "error C2371: 'pcregrep_exit' : redefinition;" that was + reported by a user. I've moved the definition above the reference. Version 8.11 10-Dec-2010 @@ -296,6 +296,30 @@ const char utf8_table4[] = { /************************************************* +* Exit from the program * +*************************************************/ + +/* If there has been a resource error, give a suitable message. + +Argument: the return code +Returns: does not return +*/ + +static void +pcregrep_exit(int rc) +{ +if (resource_error) + { + fprintf(stderr, "pcregrep: Error %d or %d means that a resource limit " + "was exceeded.\n", PCRE_ERROR_MATCHLIMIT, PCRE_ERROR_RECURSIONLIMIT); + fprintf(stderr, "pcregrep: Check your regex for nested unlimited loops.\n"); + } + +exit(rc); +} + + +/************************************************* * OS-specific functions * *************************************************/ @@ -565,31 +589,6 @@ return sys_errlist[n]; /************************************************* -* Exit from the program * -*************************************************/ - -/* If there has been a resource error, give a suitable message. - -Argument: the return code -Returns: does not return -*/ - -static void -pcregrep_exit(int rc) -{ -if (resource_error) - { - fprintf(stderr, "pcregrep: Error %d or %d means that a resource limit " - "was exceeded.\n", PCRE_ERROR_MATCHLIMIT, PCRE_ERROR_RECURSIONLIMIT); - fprintf(stderr, "pcregrep: Check your regex for nested unlimited loops.\n"); - } - -exit(rc); -} - - - -/************************************************* * Read one line of input * *************************************************/ |