Commit Graph

881 Commits

Author SHA1 Message Date
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:55:24 +02:00
Peter Kokot
85290bbfcc Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:23:20 +02:00
Remi Collet
bbfea4b470 Allow to disable pcre.jit when system library is used
as it is for now broken on some arch (s390x...)
2018-10-04 11:45:35 +02:00
Anatol Belski
9f3aac9e39 Fix test and add skip section 2018-09-22 02:10:43 +02:00
Anatol Belski
9c58ab37c7 Add test for bug #76909 2018-09-21 15:57:00 +02:00
Anatol Belski
7a02ecb7fe Fixed bug #76909 preg_match difference between 7.3 and < 7.3
Applied upstream patch, see https://bugs.exim.org/show_bug.cgi?id=2321
2018-09-21 15:55:03 +02:00
Anatol Belski
91b2b6c65d Upgrade PCRE2 to 10.32
(cherry picked from commit d918e0776b)
2018-09-21 15:54:14 +02:00
Anatol Belski
27b270de89 Skip test on unsuitable env 2018-09-10 09:51:36 +02:00
Anatol Belski
68c34ce0dc Make a copy unconditionally 2018-09-09 10:42:53 +02:00
Anatol Belski
9278be148e Fix memory leak in pcre cache 2018-09-09 10:38:36 +02:00
Anatol Belski
4905d5e0df Add test for bug #76850 2018-09-08 21:39:54 +02:00
Anatol Belski
c6ddd45650 Fixed bug #76850 Exit code mangled by set locale/preg_match 2018-09-08 21:35:23 +02:00
Gabriel Caruso
1461f8ef0d
Remove superfluous SKIPIF sections of always available functions 2018-07-29 15:42:19 -03:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +02:00
Gabriel Caruso
9e4d590b19
Remove extra semicolons 2018-07-25 21:47:04 -03:00
Peter Kokot
a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
5be44312f8 Removed redundand code 2018-07-19 15:47:15 +03:00
Dmitry Stogov
54ebebd686 Matching loops optimization 2018-07-19 15:28:31 +03:00
Dmitry Stogov
b81d712961 Micro optimizations 2018-07-19 11:19:28 +03:00
Dmitry Stogov
1820f2f2f3 Reorder conditions 2018-07-18 17:46:48 +03:00
Dmitry Stogov
29f942b3d0 Move "/e" modifier check into regex compiler 2018-07-18 16:35:17 +03:00
Dmitry Stogov
5d60651165 Merge "no_utf_check" and "g_notempty" into single "options". 2018-07-18 16:10:41 +03:00
Anatol Belski
81eb8e7507 Mark conditions unexpected 2018-07-11 18:05:28 +02:00
Anatol Belski
0630e3bc03 Reduce error buffer size
120 bytes is ample, the doc says.
2018-07-05 17:24:38 +02:00
Anatol Belski
ff8f2710f6 Check return value of pcre2_maketables() 2018-06-29 19:15:38 +02:00
Anatol Belski
e03739d4ab Remove obsolete version checks in tests 2018-06-22 17:56:18 +02:00
Anatol Belski
aa92d42018 If there's no setlocale, char tables are not used 2018-06-22 17:31:26 +02:00
Anatol Belski
8b58b2aac6 Don't discard char tables just generated 2018-06-22 15:18:39 +02:00
Anatol Belski
684ce24eec Improve locale character tables handling and reduce pattern cache size
If a locale other than C is active, character tables are saved into the
compile context. Every compiled pattern will have a pointer to the
character table, that was present in the context at the time of the
pattern compilation. Thus, the cache entries don't need to carry char
tables pointer, which reduces their size to 8 bytes on 64-bit. Instead,
the generated character tables are tracked in a separate HashTable. If a
character table was generated before, it'll be assigned to the compile
context when the locale changes. Otherwise a new char table will be
generated and cached.
2018-06-22 14:45:29 +02:00
Anatol Belski
bb2f1a6830 Fixed bug #76514 Regression in preg_match makes it fail with PREG_JIT_STACKLIMIT_ERROR
Looks like some patterns might require more stack for JIT execution. It
is a regression, as the same pattern was passing using JIT.
2018-06-22 11:05:30 +02:00
Christoph M. Becker
23ca95aa3e Fix line endings in new PHPT 2018-06-22 00:01:51 +02:00
Christoph M. Becker
71d16feebb Fix #76512: \w no longer includes unicode characters
The migration from PCRE to PCRE2 missed to rename once occurrence of
`PCRE_UCP` to `PCRE2_UCP`.  We fix that.  We also revert the changes to
bug52971.phpt which had been incorrectly made in commit a5bc5ae[1].

[1] <http://git.php.net/?p=php-src.git;a=commit;h=a5bc5aed71f7a15f14f33bb31b8e17bf5f327e2d>
2018-06-21 22:45:08 +02:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski
16216b6666 Switch to more robust config for external pcre2
For the standard layout the first option is pkg-config. Otherwise,
pcre2-config is used, which is produced by a manual installation into a
prefix. This removes the most of the hackish pieces like checking for
the lib filenames and parsing headers.
2018-04-26 14:20:36 +02:00
Anatol Belski
d22d99a344 Fix regex 2018-04-25 16:30:10 +02:00
Anatol Belski
217354899b Revamp pcre config for build with external lib
- support multiarch in addition to the usual lib path
- fix symbol checks
- fix jit availability check
- exit early on unsupported version
2018-04-25 16:17:20 +02:00
Anatol Belski
e107a03419 Fix lib names for build with external libpcre2 2018-04-24 17:06:27 +02:00
Gabriel Caruso
b895690dfa
remove support for string|unicode in tests 2018-02-22 08:11:30 +01:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Anatol Belski
28132878f2 Reduce var scope 2018-02-17 13:02:49 +01:00
Anatol Belski
703e037090 Upgrade bundled PCRE2 to 10.31 2018-02-14 13:44:38 +01:00
Gabriel Caruso
21e3b0c70c Remove trailing whitespace in inc files 2018-02-10 19:20:23 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
53dbc69a8d Use %d when expecting line number in tests 2018-02-02 22:35:13 +01:00
Gabriel Caruso
2238403892 Trailing whitespaces on ext/*
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-04 02:38:32 -02:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
856ad54f45 Use zend_hash_find() instead of zend_hash_find_ptr() to avoid double check 2017-12-27 13:25:21 +03:00