X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/92e772ff5013bdd9cd67ed05a9cb54369a07f993..47db112512e23853b60b6ecea208056818e10907:/src/src/pcre/pcre_try_flipped.c diff --git a/src/src/pcre/pcre_try_flipped.c b/src/src/pcre/pcre_try_flipped.c index 3069d1fb0..ba97ccb7a 100644 --- a/src/src/pcre/pcre_try_flipped.c +++ b/src/src/pcre/pcre_try_flipped.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/pcre/pcre_try_flipped.c,v 1.2 2005/08/08 10:22:14 ph10 Exp $ */ +/* $Cambridge: exim/src/src/pcre/pcre_try_flipped.c,v 1.6 2007/11/12 13:02:20 nm4 Exp $ */ /************************************************* * Perl-Compatible Regular Expressions * @@ -8,7 +8,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2005 University of Cambridge + Copyright (c) 1997-2007 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -45,6 +45,10 @@ see if it was compiled with the opposite endianness. If so, it uses an auxiliary local function to flip the appropriate bytes. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "pcre_internal.h" @@ -64,8 +68,8 @@ Arguments: Returns: the flipped value */ -static long int -byteflip(long int value, int n) +static unsigned long int +byteflip(unsigned long int value, int n) { if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8); return ((value & 0x000000ff) << 24) | @@ -96,7 +100,7 @@ Returns: the new block if is is indeed a byte-flipped regex NULL if it is not */ -EXPORT real_pcre * +real_pcre * _pcre_try_flipped(const real_pcre *re, real_pcre *internal_re, const pcre_study_data *study, pcre_study_data *internal_study) { @@ -106,6 +110,7 @@ if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER) *internal_re = *re; /* To copy other fields */ internal_re->size = byteflip(re->size, sizeof(re->size)); internal_re->options = byteflip(re->options, sizeof(re->options)); +internal_re->flags = (pcre_uint16)byteflip(re->flags, sizeof(re->flags)); internal_re->top_bracket = (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket)); internal_re->top_backref =