summaryrefslogtreecommitdiffstats
path: root/contrib/libs/pcre/pcre_newline.c
diff options
context:
space:
mode:
authororivej <[email protected]>2022-02-10 16:45:01 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:01 +0300
commit2d37894b1b037cf24231090eda8589bbb44fb6fc (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/pcre/pcre_newline.c
parent718c552901d703c502ccbefdfc3c9028d608b947 (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/pcre/pcre_newline.c')
-rw-r--r--contrib/libs/pcre/pcre_newline.c168
1 files changed, 84 insertions, 84 deletions
diff --git a/contrib/libs/pcre/pcre_newline.c b/contrib/libs/pcre/pcre_newline.c
index 8dac0a1abfe..252cad9c9e3 100644
--- a/contrib/libs/pcre/pcre_newline.c
+++ b/contrib/libs/pcre/pcre_newline.c
@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
- Copyright (c) 1997-2012 University of Cambridge
+ Copyright (c) 1997-2012 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,7 @@ http://unicode.org/unicode/reports/tr18/. */
#ifdef HAVE_CONFIG_H
-#include "pcre_config.h"
+#include "pcre_config.h"
#endif
#include "pcre_internal.h"
@@ -67,33 +67,33 @@ Arguments:
type the newline type
endptr pointer to the end of the string
lenptr where to return the length
- utf TRUE if in utf mode
+ utf TRUE if in utf mode
Returns: TRUE or FALSE
*/
BOOL
-PRIV(is_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR endptr, int *lenptr,
- BOOL utf)
+PRIV(is_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR endptr, int *lenptr,
+ BOOL utf)
{
-pcre_uint32 c;
-(void)utf;
-#ifdef SUPPORT_UTF
-if (utf)
- {
- GETCHAR(c, ptr);
- }
-else
-#endif /* SUPPORT_UTF */
- c = *ptr;
-
-/* Note that this function is called only for ANY or ANYCRLF. */
-
+pcre_uint32 c;
+(void)utf;
+#ifdef SUPPORT_UTF
+if (utf)
+ {
+ GETCHAR(c, ptr);
+ }
+else
+#endif /* SUPPORT_UTF */
+ c = *ptr;
+
+/* Note that this function is called only for ANY or ANYCRLF. */
+
if (type == NLTYPE_ANYCRLF) switch(c)
{
- case CHAR_LF: *lenptr = 1; return TRUE;
- case CHAR_CR: *lenptr = (ptr < endptr - 1 && ptr[1] == CHAR_LF)? 2 : 1;
- return TRUE;
+ case CHAR_LF: *lenptr = 1; return TRUE;
+ case CHAR_CR: *lenptr = (ptr < endptr - 1 && ptr[1] == CHAR_LF)? 2 : 1;
+ return TRUE;
default: return FALSE;
}
@@ -101,29 +101,29 @@ if (type == NLTYPE_ANYCRLF) switch(c)
else switch(c)
{
-#ifdef EBCDIC
- case CHAR_NEL:
-#endif
- case CHAR_LF:
- case CHAR_VT:
- case CHAR_FF: *lenptr = 1; return TRUE;
-
- case CHAR_CR:
- *lenptr = (ptr < endptr - 1 && ptr[1] == CHAR_LF)? 2 : 1;
- return TRUE;
-
-#ifndef EBCDIC
-#ifdef COMPILE_PCRE8
- case CHAR_NEL: *lenptr = utf? 2 : 1; return TRUE;
+#ifdef EBCDIC
+ case CHAR_NEL:
+#endif
+ case CHAR_LF:
+ case CHAR_VT:
+ case CHAR_FF: *lenptr = 1; return TRUE;
+
+ case CHAR_CR:
+ *lenptr = (ptr < endptr - 1 && ptr[1] == CHAR_LF)? 2 : 1;
+ return TRUE;
+
+#ifndef EBCDIC
+#ifdef COMPILE_PCRE8
+ case CHAR_NEL: *lenptr = utf? 2 : 1; return TRUE;
case 0x2028: /* LS */
case 0x2029: *lenptr = 3; return TRUE; /* PS */
-#else /* COMPILE_PCRE16 || COMPILE_PCRE32 */
- case CHAR_NEL:
- case 0x2028: /* LS */
- case 0x2029: *lenptr = 1; return TRUE; /* PS */
-#endif /* COMPILE_PCRE8 */
-#endif /* Not EBCDIC */
-
+#else /* COMPILE_PCRE16 || COMPILE_PCRE32 */
+ case CHAR_NEL:
+ case 0x2028: /* LS */
+ case 0x2029: *lenptr = 1; return TRUE; /* PS */
+#endif /* COMPILE_PCRE8 */
+#endif /* Not EBCDIC */
+
default: return FALSE;
}
}
@@ -142,67 +142,67 @@ Arguments:
type the newline type
startptr pointer to the start of the string
lenptr where to return the length
- utf TRUE if in utf mode
+ utf TRUE if in utf mode
Returns: TRUE or FALSE
*/
BOOL
-PRIV(was_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR startptr, int *lenptr,
- BOOL utf)
+PRIV(was_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR startptr, int *lenptr,
+ BOOL utf)
{
-pcre_uint32 c;
-(void)utf;
+pcre_uint32 c;
+(void)utf;
ptr--;
-#ifdef SUPPORT_UTF
-if (utf)
+#ifdef SUPPORT_UTF
+if (utf)
{
BACKCHAR(ptr);
GETCHAR(c, ptr);
}
-else
-#endif /* SUPPORT_UTF */
- c = *ptr;
+else
+#endif /* SUPPORT_UTF */
+ c = *ptr;
+
+/* Note that this function is called only for ANY or ANYCRLF. */
-/* Note that this function is called only for ANY or ANYCRLF. */
-
if (type == NLTYPE_ANYCRLF) switch(c)
{
- case CHAR_LF:
- *lenptr = (ptr > startptr && ptr[-1] == CHAR_CR)? 2 : 1;
- return TRUE;
-
- case CHAR_CR: *lenptr = 1; return TRUE;
+ case CHAR_LF:
+ *lenptr = (ptr > startptr && ptr[-1] == CHAR_CR)? 2 : 1;
+ return TRUE;
+
+ case CHAR_CR: *lenptr = 1; return TRUE;
default: return FALSE;
}
-/* NLTYPE_ANY */
-
+/* NLTYPE_ANY */
+
else switch(c)
{
- case CHAR_LF:
- *lenptr = (ptr > startptr && ptr[-1] == CHAR_CR)? 2 : 1;
- return TRUE;
-
-#ifdef EBCDIC
- case CHAR_NEL:
-#endif
- case CHAR_VT:
- case CHAR_FF:
- case CHAR_CR: *lenptr = 1; return TRUE;
-
-#ifndef EBCDIC
-#ifdef COMPILE_PCRE8
- case CHAR_NEL: *lenptr = utf? 2 : 1; return TRUE;
- case 0x2028: /* LS */
- case 0x2029: *lenptr = 3; return TRUE; /* PS */
-#else /* COMPILE_PCRE16 || COMPILE_PCRE32 */
- case CHAR_NEL:
- case 0x2028: /* LS */
- case 0x2029: *lenptr = 1; return TRUE; /* PS */
-#endif /* COMPILE_PCRE8 */
-#endif /* NotEBCDIC */
-
+ case CHAR_LF:
+ *lenptr = (ptr > startptr && ptr[-1] == CHAR_CR)? 2 : 1;
+ return TRUE;
+
+#ifdef EBCDIC
+ case CHAR_NEL:
+#endif
+ case CHAR_VT:
+ case CHAR_FF:
+ case CHAR_CR: *lenptr = 1; return TRUE;
+
+#ifndef EBCDIC
+#ifdef COMPILE_PCRE8
+ case CHAR_NEL: *lenptr = utf? 2 : 1; return TRUE;
+ case 0x2028: /* LS */
+ case 0x2029: *lenptr = 3; return TRUE; /* PS */
+#else /* COMPILE_PCRE16 || COMPILE_PCRE32 */
+ case CHAR_NEL:
+ case 0x2028: /* LS */
+ case 0x2029: *lenptr = 1; return TRUE; /* PS */
+#endif /* COMPILE_PCRE8 */
+#endif /* NotEBCDIC */
+
default: return FALSE;
}
}