diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-09-10 11:02:48 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-09-10 11:02:48 +0000 |
commit | 7a3e01c442328741902c3c4b974d0e3024f645d1 (patch) | |
tree | e61b4534e91f97df907571a92db57623422e71d7 /pcregrep.c | |
parent | 640564bfeb0860032d98439dfa9f5585af59a09e (diff) | |
download | pcre-7a3e01c442328741902c3c4b974d0e3024f645d1.tar.gz |
General spring-clean of EBCDIC-related issues in the code, which had decayed
over time. Also the documentation. Added one test that can be run in an ASCII
world to do a little testing of EBCDIC-related things.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1033 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcregrep.c')
-rw-r--r-- | pcregrep.c | 44 |
1 files changed, 24 insertions, 20 deletions
@@ -933,12 +933,12 @@ switch(endlinetype) switch (c) { - case 0x0a: /* LF */ + case '\n': *lenptr = 1; return p; - case 0x0d: /* CR */ - if (p < endptr && *p == 0x0a) + case '\r': + if (p < endptr && *p == '\n') { *lenptr = 2; p++; @@ -977,14 +977,14 @@ switch(endlinetype) switch (c) { - case 0x0a: /* LF */ - case 0x0b: /* VT */ - case 0x0c: /* FF */ + case '\n': /* LF */ + case '\v': /* VT */ + case '\f': /* FF */ *lenptr = 1; return p; - case 0x0d: /* CR */ - if (p < endptr && *p == 0x0a) + case '\r': /* CR */ + if (p < endptr && *p == '\n') { *lenptr = 2; p++; @@ -992,14 +992,16 @@ switch(endlinetype) else *lenptr = 1; return p; - case 0x85: /* NEL */ +#ifndef EBCDIC + case 0x85: /* Unicode NEL */ *lenptr = utf8? 2 : 1; return p; - case 0x2028: /* LS */ - case 0x2029: /* PS */ + case 0x2028: /* Unicode LS */ + case 0x2029: /* Unicode PS */ *lenptr = 3; return p; +#endif /* Not EBCDIC */ default: break; @@ -1083,8 +1085,8 @@ switch(endlinetype) if (endlinetype == EL_ANYCRLF) switch (c) { - case 0x0a: /* LF */ - case 0x0d: /* CR */ + case '\n': /* LF */ + case '\r': /* CR */ return p; default: @@ -1093,13 +1095,15 @@ switch(endlinetype) else switch (c) { - case 0x0a: /* LF */ - case 0x0b: /* VT */ - case 0x0c: /* FF */ - case 0x0d: /* CR */ - case 0x85: /* NEL */ - case 0x2028: /* LS */ - case 0x2029: /* PS */ + case '\n': /* LF */ + case '\v': /* VT */ + case '\f': /* FF */ + case '\r': /* CR */ +#ifndef EBCDIE + case 0x85: /* Unicode NEL */ + case 0x2028: /* Unicode LS */ + case 0x2029: /* Unicode PS */ +#endif /* Not EBCDIC */ return p; default: |