mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
390
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4d3a4d2ca | ||
|
|
bd5c8eda11 | ||
|
|
eed9061d17 | ||
|
|
57f0b50158 | ||
|
|
861c352d76 | ||
|
|
79ecb58b62 | ||
|
|
e04c3b66a8 | ||
|
|
3bebc2f50d | ||
|
|
74cb3c6816 | ||
|
|
7841f94196 | ||
|
|
b23f3cd862 | ||
|
|
bc9bdc928e | ||
|
|
8250e206b8 | ||
|
|
3a9363d0d8 | ||
|
|
67947770dc | ||
|
|
37e30ce89d | ||
|
|
4e98e031b5 | ||
|
|
fff5a8df8e | ||
|
|
ccacb9fefc | ||
|
|
51a34ef7ed | ||
|
|
b686fd9053 | ||
|
|
0c2ba7a0e0 | ||
|
|
7b3f1787cc | ||
|
|
0cf5a9e521 | ||
|
|
6c3beee05d | ||
|
|
5ca87f290c | ||
|
|
0d9e4e7415 | ||
|
|
67a2f44fc8 | ||
|
|
fc5134c783 | ||
|
|
8ff9d33c6c | ||
|
|
7353529de9 | ||
|
|
44af72814f | ||
|
|
faa2ed1975 | ||
|
|
a2e5f4bbf8 | ||
|
|
ce77a5c7d2 | ||
|
|
1c7d5e70ff | ||
|
|
98bc75b85d | ||
|
|
f7c7f5df59 | ||
|
|
7869d9d068 | ||
|
|
60588cbdd5 | ||
|
|
3cc05ab729 | ||
|
|
83c89d69b6 | ||
|
|
a5b3ddd830 | ||
|
|
166366a763 | ||
|
|
5f8e696b08 | ||
|
|
3e3788177f | ||
|
|
83828a3ddb | ||
|
|
54a446971f | ||
|
|
db2cce5fea | ||
|
|
d7ddbd5ccf | ||
|
|
1432e64a65 | ||
|
|
d7b5260778 | ||
|
|
244da70588 | ||
|
|
9fb9355926 | ||
|
|
506b26f172 | ||
|
|
25df29e223 | ||
|
|
58feae40d8 | ||
|
|
781f3415f4 | ||
|
|
6518e93455 | ||
|
|
c896e0c8b3 | ||
|
|
1654bd1a15 | ||
|
|
5bd5140bf2 | ||
|
|
163fdbd165 | ||
|
|
e05fdf201c | ||
|
|
699c05e624 | ||
|
|
f4e273c6c5 | ||
|
|
597a187c83 | ||
|
|
d1d768f3f6 | ||
|
|
d75d78ee4b | ||
|
|
d6acf12a59 | ||
|
|
9b2e43d32a | ||
|
|
23102e230e | ||
|
|
5fbad6aecd | ||
|
|
92929f25c9 | ||
|
|
f904d6334c | ||
|
|
cd493bbf44 | ||
|
|
25291357cf | ||
|
|
af0db591ee | ||
|
|
b3d4f286b4 | ||
|
|
36d77ffc31 | ||
|
|
e51cba4da9 | ||
|
|
36103f62f7 | ||
|
|
be925c44bb | ||
|
|
e144b946e8 | ||
|
|
ec23cfecec | ||
|
|
37882b694e | ||
|
|
bb67f76616 | ||
|
|
c0860a5fa9 | ||
|
|
e31766df10 | ||
|
|
d3deda3ea2 | ||
|
|
baba58057a | ||
|
|
e5247d0dd0 | ||
|
|
fcb34ab808 | ||
|
|
2087dad15d | ||
|
|
33131298f3 | ||
|
|
2b4ec789be | ||
|
|
afcea496f3 | ||
|
|
1d5c4c483e | ||
|
|
442ae48592 | ||
|
|
9fe0cc29f8 | ||
|
|
75ad7747eb | ||
|
|
062443ea97 | ||
|
|
f9e8d2164e | ||
|
|
fe9f85f820 | ||
|
|
c6d4c0c85a | ||
|
|
fbaf5b4133 | ||
|
|
e8f5e0ca98 | ||
|
|
3a1c15ec59 | ||
|
|
f13f22564b | ||
|
|
4790ee77b2 | ||
|
|
58c7a08146 | ||
|
|
b4cee52c76 | ||
|
|
036b27a713 | ||
|
|
d2b4a581a5 | ||
|
|
114e77f187 | ||
|
|
33323771a4 | ||
|
|
0edbc8d501 | ||
|
|
eaa4340224 | ||
|
|
3560f8ffea | ||
|
|
152cf49b08 | ||
|
|
e71445e2d6 | ||
|
|
8842221453 | ||
|
|
4a8738b3c7 | ||
|
|
f103c3eb32 | ||
|
|
10970b6f5a | ||
|
|
7739117293 | ||
|
|
d0d6ef7758 | ||
|
|
c051579ef0 | ||
|
|
29d9c1ebb9 | ||
|
|
8bed0a1f8c | ||
|
|
6932c74dd6 | ||
|
|
fc6bdb845d | ||
|
|
1901a20ab7 | ||
|
|
7e424740fd | ||
|
|
9aa88b4ec8 | ||
|
|
c07cf3df4f | ||
|
|
595c0aa04f | ||
|
|
87233253a4 | ||
|
|
2129fbd1d4 | ||
|
|
5ca8e3991e | ||
|
|
dc733cb576 | ||
|
|
02430a4f61 | ||
|
|
c297434175 | ||
|
|
5ed01dccb5 | ||
|
|
61261dc5b9 | ||
|
|
25f51c3cbf | ||
|
|
3e1120f987 | ||
|
|
2aaa4adce4 | ||
|
|
87f091b0e1 | ||
|
|
faede09954 | ||
|
|
a99fa18f27 | ||
|
|
0f0d36315a | ||
|
|
a1f049f9c7 | ||
|
|
f3c6f9fd8e | ||
|
|
f5466ed7a7 | ||
|
|
38cc059411 | ||
|
|
ecdc70986b | ||
|
|
5473232607 | ||
|
|
5444943d0f | ||
|
|
f854b90ed4 | ||
|
|
42e3e2e12e | ||
|
|
82dc6e1cfb | ||
|
|
f5fc2866a6 | ||
|
|
ec4f115b41 | ||
|
|
25b5bbc7a1 | ||
|
|
a8bcb208ef | ||
|
|
1e1799dd21 | ||
|
|
afb1540b1e | ||
|
|
f1d4dc3bbc | ||
|
|
0be9ce7a76 | ||
|
|
257375765a | ||
|
|
a8154b3540 | ||
|
|
3634ab8189 | ||
|
|
66dcd76874 | ||
|
|
13ea7d0109 | ||
|
|
f87648eaa5 | ||
|
|
cfaf561b6d | ||
|
|
b419742b44 | ||
|
|
d75be587a4 | ||
|
|
5ed521bc6d | ||
|
|
c8123f93f0 | ||
|
|
746301b213 | ||
|
|
a857541f5f | ||
|
|
d81b4d37ea | ||
|
|
afdc0907f7 | ||
|
|
8351d9c7f3 | ||
|
|
7637f98be2 | ||
|
|
2f37c4ddb0 | ||
|
|
f437f392e2 | ||
|
|
aadba93278 | ||
|
|
3052e0cc5f | ||
|
|
8b8c928063 | ||
|
|
87b7293e4b | ||
|
|
f025e896df | ||
|
|
95f42dfa20 | ||
|
|
df0bb9a837 | ||
|
|
4f6da2642e | ||
|
|
b307db4b1c | ||
|
|
5f92ac3bab | ||
|
|
d8a6d67a82 | ||
|
|
bc351a3c1f | ||
|
|
c1e7797d54 | ||
|
|
4d59918076 | ||
|
|
02ba2f45bd | ||
|
|
a3c17c2fb2 | ||
|
|
55ff6ffa97 | ||
|
|
b4476a8469 | ||
|
|
6f53386349 | ||
|
|
d1da486599 | ||
|
|
e5cf4ead35 | ||
|
|
71f1155373 | ||
|
|
fb1dff44d9 | ||
|
|
30331e79a6 | ||
|
|
ac990417d0 | ||
|
|
118849bf3e | ||
|
|
a7a27febc5 | ||
|
|
426b1765a2 | ||
|
|
09f17195d9 | ||
|
|
b496675bf4 | ||
|
|
993e170e7a | ||
|
|
e31c34f68f | ||
|
|
226b4b1ef3 | ||
|
|
42bc8e3219 | ||
|
|
18a27fa07f | ||
|
|
c05c4e0621 | ||
|
|
3ff27a3096 | ||
|
|
64107bef55 | ||
|
|
2ae64d7122 | ||
|
|
c32694530c | ||
|
|
1346c157a3 | ||
|
|
3aa751b306 | ||
|
|
fe057d8ed4 | ||
|
|
4cfe224921 | ||
|
|
9be6cc3d11 | ||
|
|
161c8ed86b | ||
|
|
f67c006ec3 | ||
|
|
7d39cfd613 | ||
|
|
50dddf94f5 | ||
|
|
ac15fe506f | ||
|
|
615b56e229 | ||
|
|
6a12c3aac4 | ||
|
|
6cc3372fb2 | ||
|
|
5342dbac8c | ||
|
|
e05159b701 | ||
|
|
5125d99507 | ||
|
|
f16e359621 | ||
|
|
234c4a39da | ||
|
|
a0f0f86e0e | ||
|
|
2668902ef1 | ||
|
|
162e7f1ca5 | ||
|
|
d74d887e7f | ||
|
|
22caa93806 | ||
|
|
5809160626 | ||
|
|
1d2e5068ca | ||
|
|
3536db6a6b | ||
|
|
c1fe8b81aa | ||
|
|
e120d29f96 | ||
|
|
3a6312932c | ||
|
|
428a990d2a | ||
|
|
cc19fb16f3 | ||
|
|
b1dc9ef05c | ||
|
|
0f56bde0a8 | ||
|
|
b34174d465 | ||
|
|
5d057a8790 | ||
|
|
4baade098f | ||
|
|
85865584fd | ||
|
|
c1e5091166 | ||
|
|
6faa926224 | ||
|
|
33b6ea71bf | ||
|
|
b7d18bdcab | ||
|
|
bed700e088 | ||
|
|
2e0a82c0b8 | ||
|
|
7d377d05ec | ||
|
|
b9cab2b5f2 | ||
|
|
fb6a30cdde | ||
|
|
62bf10bd52 | ||
|
|
c188c0f5be | ||
|
|
8c5ecd2856 | ||
|
|
78d9152751 | ||
|
|
d98d470f55 | ||
|
|
609ddf2cec | ||
|
|
9063a993f4 | ||
|
|
5e6b239fd4 | ||
|
|
49c25f632b | ||
|
|
507e1fd5a2 | ||
|
|
d4f2cb0af2 | ||
|
|
5b80cd2752 | ||
|
|
a1c5b88515 | ||
|
|
755c74b607 | ||
|
|
3072d1bb2b | ||
|
|
b2f943dea3 | ||
|
|
90862d7e7f | ||
|
|
39601bb33b | ||
|
|
e640197929 | ||
|
|
50d1af20c5 | ||
|
|
6af0ebfebf | ||
|
|
b3ddd1b71d | ||
|
|
0063ffc124 | ||
|
|
f6753e96e3 | ||
|
|
bb31f21dfb | ||
|
|
5fb5cfdbca | ||
|
|
4d0daac738 | ||
|
|
88e06a97be | ||
|
|
7f5d77afb5 | ||
|
|
ed53169150 | ||
|
|
a2e5235b92 | ||
|
|
88b15c81ee | ||
|
|
811b100140 | ||
|
|
0f26edab9d | ||
|
|
7eda78c8ce | ||
|
|
5795b68a12 | ||
|
|
01e67c1c0b | ||
|
|
5df81174c6 | ||
|
|
4ccfd8e5f4 | ||
|
|
3066881dea | ||
|
|
adcd660665 | ||
|
|
39c97daa7a | ||
|
|
42e35b8c87 | ||
|
|
b1095970bc | ||
|
|
eeccf79e5c | ||
|
|
0f30174f3c | ||
|
|
727982d268 | ||
|
|
7a80b0a24b | ||
|
|
8d13007f31 | ||
|
|
da6fe839bf | ||
|
|
0f2418d470 | ||
|
|
687ebaa977 | ||
|
|
fa431b2bd5 | ||
|
|
8c9578b492 | ||
|
|
4ad132a162 | ||
|
|
018dc1e52e | ||
|
|
67fdeb1067 | ||
|
|
ccf09f5bbe | ||
|
|
0946fc2fbf | ||
|
|
07e361458a | ||
|
|
779c4394e4 | ||
|
|
25a03fe695 | ||
|
|
303cd902ec | ||
|
|
7beb2b51b3 | ||
|
|
c748070bfe | ||
|
|
324b3f960f | ||
|
|
4980266aca | ||
|
|
024d1a5aa3 | ||
|
|
34f6ba497b | ||
|
|
30f4b5f323 | ||
|
|
076f4c4433 | ||
|
|
2f138334e5 | ||
|
|
0fa88bff91 | ||
|
|
75d2330427 | ||
|
|
f7c3d6c8ad | ||
|
|
32211ba99f | ||
|
|
ef36d846bc | ||
|
|
476f9c5948 | ||
|
|
63251c4c5e | ||
|
|
d7cd8d3909 | ||
|
|
134f474e5f | ||
|
|
7a03b57390 | ||
|
|
0f5d980c2f | ||
|
|
6e543a0b4d | ||
|
|
56fcffbec5 | ||
|
|
2d52e47e48 | ||
|
|
f159b33aa9 | ||
|
|
045baa569a | ||
|
|
259613b0ec | ||
|
|
8fbbbc41b7 | ||
|
|
6eb4034257 | ||
|
|
3d497a4f7f | ||
|
|
9967278b85 | ||
|
|
f3590cce7d | ||
|
|
af4c393004 | ||
|
|
edf4e8a023 | ||
|
|
38cf5db6d2 | ||
|
|
7ce3868b29 | ||
|
|
a6ebb49ea5 | ||
|
|
077194ed30 | ||
|
|
b1992efb19 | ||
|
|
927d6e218f | ||
|
|
8c6e6ec40e | ||
|
|
d2628e4c2a | ||
|
|
0047baef1f | ||
|
|
9784bb3697 | ||
|
|
c07983db9c | ||
|
|
9e69c67c07 | ||
|
|
7cb8058dc3 | ||
|
|
20eb636856 | ||
|
|
dd2be9ac1f | ||
|
|
60bcbd4d17 | ||
|
|
3c2441dc02 | ||
|
|
855359278e | ||
|
|
688d86a417 |
No files matched your search
@@ -1,8 +1,195 @@
|
||||
PHP 4 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
05 Jan 2006, Version 4.4.2RC2
|
||||
07 Aug 2008, Version 4.4.9
|
||||
- Updated PCRE to version 7.7. (Nuno)
|
||||
- Fixed overflow in memnstr(). (Reported by Laurent Gaffie, Derick)
|
||||
- Fixed crash in imageloadfont when an invalid font is given.
|
||||
(discovered by CzechSec, fixed by Pierre)
|
||||
- Fixed open_basedir handling issue in the curl extension. (Stas)
|
||||
- Fixed bug #37421 (mbstring.func_overload set in .htaccess becomes global).
|
||||
(Rui)
|
||||
|
||||
03 Jan 2008, Version 4.4.8
|
||||
- Improved fix for MOPB-02-2007. (Ilia)
|
||||
- Fixed an integer overflow inside chunk_split(). Identified by Gerhard Wagner.
|
||||
(Ilia)
|
||||
- Fixed integer overlow in str[c]spn(). (Stas)
|
||||
- Fixed regression in glob when open_basedir is on introduced by #41655 fix
|
||||
(Pierre)
|
||||
- Fixed money_format() not to accept multiple %i or %n tokens. (Stas, Ilia)
|
||||
- Addded "max_input_nesting_level" php.ini option to limit nesting level of
|
||||
input variables. Fix for MOPB-03-2007. (Stas)
|
||||
- Fixed INFILE LOCAL option handling with MySQL - now not allowed when
|
||||
open_basedir or safe_mode is active (Stas)
|
||||
- Fixed session.save_path and error_log values to be checked against
|
||||
open_basedir and safe_mode (CVE-2007-3378) (Stas, Maksymilian Arciemowicz)
|
||||
- Fixed bug #43010 (Fixed regression in imagearc with two equivelent angles)
|
||||
(Pierre)
|
||||
- Fixed bug #41765 (Recode crashes/does not work on amd64)
|
||||
(nexus at smoula dot net, Stas)
|
||||
- Fixed bug #41630 (segfault when an invalid color index is present in
|
||||
the image data). (Reported by Elliot <wccoder@gmail dot com>) (Pierre)
|
||||
- Fixed bug #41628 (PHP settings leak between Virtual Hosts in
|
||||
Apache 1.3). (Scott, manuel at mausz dot at)
|
||||
- Fixed bug #38798 (OpenSSL init corrected in php5 but not in php4). (Tony)
|
||||
|
||||
04 May 2007, Version 4.4.7
|
||||
- Fixed libgd #86 (Fixed possible infinite loop in imagecreatefrompng)
|
||||
(Reported by Xavier Roche) (Pierre)
|
||||
- Fixed MOPB-33-2007 (PHP mail() Message ASCIIZ Byte Truncation). (Ilia)
|
||||
- Fixed MOPB-32-2007 (Double free inside session_decode()). (Ilia)
|
||||
- Fixed MOPB-26-2007 (mb_parse_str() can be used to activate
|
||||
register_globals). (Ilia)
|
||||
- Fixed MOPB-24-2007 (Fixed unallocated memory access/double free in in
|
||||
array_user_key_compare()). (Stas)
|
||||
- Fixed MOPB-22-2007 (PHP session_regenerate_id() Double Free Vulnerability).
|
||||
(Ilia)
|
||||
- Fixed MOPB-21-2007 (An open_basedir/safe_mode bypass inside the
|
||||
compress.bzip2 wraper). (Ilia)
|
||||
- Fixed MOPB-8-2007 (XSS in phpinfo()). (Joe Orton, Stas)
|
||||
- Fixed CVE-2007-1001 (GD wbmp used with invalid image size). (Pierre)
|
||||
- Fixed CVE-2007-0455 (Buffer overflow in gdImageStringFTEx, used by imagettf
|
||||
function). (Kees Cook, Pierre)
|
||||
- Fixed bug #41655 (open_basedir bypass via glob()). (Ilia)
|
||||
- Fixed bug #41527 (WDDX deserialize numeric string array key). (Matt, Ilia)
|
||||
- Fixed bug #41252 (Calling mcrypt_generic without first calling
|
||||
mcrypt_generic_init crashes). (Derick)
|
||||
- Fixed bug #40998 (long session array keys are truncated). (Tony)
|
||||
- Fixed bug #40915 (addcslashes unexpected behavior with binary input). (Tony)
|
||||
- Fixed bug #40831 (cURL extension doesn't clean up the buffer of reused
|
||||
handle). (Tony)
|
||||
- Fixed bug #40747 (possible crash in session when save_path is out of
|
||||
open_basedir). (Tony)
|
||||
- Fixed bug #38236 (Binary data gets corrupted on multipart/formdata POST)
|
||||
(patch by ass3mbler@gmail.com)
|
||||
- Fixed huge CPU usage in imagearc when used with large angles (libgd bug #74).
|
||||
(Pierre)
|
||||
- Fixed CRLF injection inside ftp_putcmd(). (Ilia)
|
||||
|
||||
28 Feb 2007, Version 4.4.6
|
||||
- Updated PCRE to version 7.0. (Nuno)
|
||||
- Fixed segfault in ext/session when register_globals=On. (Tony)
|
||||
- Fixed bug #40635 (segfault in cURL extension). (Tony)
|
||||
- Fixed bug #40611 (possible cURL memory error). (Tony)
|
||||
- Fixed bug #40578 (imagettftext() multithreading issue). (Tony)
|
||||
- Fixed bug #40502 (ext/interbase compile failure). (Tony)
|
||||
- Fixed bug #40286 (PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when
|
||||
parent is killed). (Dmitry)
|
||||
|
||||
14 Feb 2007, Version 4.4.5
|
||||
- Upgraded PEAR to 1.5.0. (Greg)
|
||||
- Updated PCRE to version 6.7. (Ilia)
|
||||
- Moved extensions to PECL:
|
||||
. ext/ovrimos (Derick)
|
||||
|
||||
- Added a meta tag to phpinfo() output to prevent search engines from
|
||||
indexing the page. (Ilia)
|
||||
- Backported a fix in the configure tests to detect the "rounding fuzz".
|
||||
(Derick, Joe Orton)
|
||||
- Backported fix for ext/imap compilation failure with recent c-client
|
||||
versions. (Tony)
|
||||
- Fixed missing open_basedir check inside chdir() function. (Ilia)
|
||||
- Fixed bug #40335 (Compile fails when using GCC 4.1.1/binutils 2.17). (Tony)
|
||||
- Fixed bug #39971 (pg_insert/pg_update do not allow now() to be used for
|
||||
timestamp fields). (Ilia)
|
||||
- Fixed bug #39890 (using autoconf 2.6x and --with-layout=GNU breaks PEAR
|
||||
install path). (Tony)
|
||||
- Fixed bug #39819 (Using $this not in object context can cause segfaults).
|
||||
(Dmitry)
|
||||
- Fixed bug #39653 (ext/dba doesn't check for db-4.5 and db-4.4 when db4
|
||||
support is enabled). (Tony)
|
||||
- Fixed bug #39583 (ftp_put() does not change transfer mode to ASCII). (Tony)
|
||||
- Fixed bug #39458 (ftp_nlist() returns false on empty dirs). (Nuno)
|
||||
- Fixed bug #39354 (Allow building of curl extension against libcurl
|
||||
7.16.0). (Ilia)
|
||||
- Fixed bug #39034 (curl_exec() with return transfer returns TRUE on empty
|
||||
files). (Ilia)
|
||||
- Fixed bug #38963 (Fixed a possible open_basedir bypass in tempnam()). (Ilia)
|
||||
- Fixed bug #38882 (ldap_connect causes segfault with newer versions of
|
||||
OpenLDAP). (Tony)
|
||||
- Fixed bug #38859 (parse_url() fails if passing '@' in passwd). (Tony,Ilia)
|
||||
- Fixed bug #38722 (Calling undefined method prints insufficient error message)
|
||||
(Hannes)
|
||||
- Fixed bug #38534 (segfault when calling setlocale() in userspace session
|
||||
handler). (Tony)
|
||||
- Fixed bug #38450 (constructor is not called for classes used in userspace
|
||||
stream wrappers). (Tony)
|
||||
- Fixed bug #38378 (wddx_serialize_value() generates no wellformed xml).
|
||||
(sj at sjaensch dot org, grzegorz dot nosek at netart dot pl, Tony).
|
||||
- Fixed bug #37812 (aggregate_methods_by_list fails to take certain methods).
|
||||
(Hannes)
|
||||
- Fixed bug #36975 (natcasesort() causes array_pop() to misbehave). (Hannes)
|
||||
- Fixed bug #36248 (CURLOPT_HEADERFUNCTION, couldn't set the function in the
|
||||
class). (Ilia)
|
||||
- Fixed bug #34066 (recursive array_walk causes segfault). (Tony)
|
||||
|
||||
17 Aug 2006, Version 4.4.4
|
||||
- Fixed memory_limit on 64bit systems. (Stefan E.)
|
||||
- Fixed overflow on 64bit systems in str_repeat() and wordwrap(). (Stefan E.)
|
||||
- Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or safe_mode are
|
||||
enabled. (Stefan E.)
|
||||
- Fixed a memory corruption error with an invalid foreach() call. (Stefan E.,
|
||||
Dmitry, Derick)
|
||||
- Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php
|
||||
ErrorDocument). (Ilia)
|
||||
- Fixed bug #38431 (xmlrpc_get_type() crashes PHP on objects). (Tony)
|
||||
- Fixed bug #38377 (session_destroy() gives warning after
|
||||
session_regenerate_id()). (Ilia)
|
||||
- Fixed bug #38322 (reading past array in sscanf() leads to arbitary code
|
||||
execution). (Tony)
|
||||
- Fixed bug #38278 (session_cache_expire()'s value does not match phpinfo's
|
||||
session.cache_expire). (Tony)
|
||||
- Fixed bug #38251 (socket_select() and invalid arguments). (Tony)
|
||||
- Fixed bug #38183 (disable_classes=Foobar causes disabled class to be
|
||||
called Foo). (Jani)
|
||||
- Fixed bug #38112 (corrupted gif segfaults) (Pierre)
|
||||
- Fixed bug #37265 (Added missing safe_mode & open_basedir checks to
|
||||
imap_body()). (Ilia)
|
||||
- Fixed bug #29538 (number_format and problem with 0). (Matthew Wilmas)
|
||||
|
||||
03 Aug 2006, Version 4.4.3
|
||||
- Added control character checks for cURL extension's open_basedir/safe_mode
|
||||
checks. (Ilia)
|
||||
- Added overflow checks to wordwrap() function. (Ilia)
|
||||
- Added a check for special characters in the session name. (Ilia)
|
||||
- Improved safe_mode check for the error_log() function. (Ilia)
|
||||
- Updated PCRE to version 6.6. (Andrei)
|
||||
- Fixed handling of extremely long paths inside tempnam() function. (Ilia)
|
||||
- Fixed XSS inside phpinfo() with long inputs. (Ilia)
|
||||
- Fixed a possible buffer overflow inside create_named_pipe() for Win32 systems
|
||||
in libmysql.c. (Ilia)
|
||||
- Fixed bug #37720 (merge_php_config scrambles values). (Mike,
|
||||
pumuckel at metropolis dot de)
|
||||
- Fixed bug #37569 (WDDX incorrectly encodes high-ascii characters). (Ilia)
|
||||
- Fixed bug #37510 (session_regenerate_id changes session_id() even on failure).
|
||||
(Hannes)
|
||||
- Fixed bug #37360 (Memory errors with a corrupt GIF file) (Pierre)
|
||||
- Fixed bug #37348 (Make PEAR install ignore open_basedir). (Ilia)
|
||||
- Fixed bug #37346 (Crashes when using an invalid colormap format). (Pierre)
|
||||
- Fixed bug #37162 (wddx does not build as a shared extension).
|
||||
(jdolecek at NetBSD dot org, Ilia)
|
||||
- Fixed bug #37046 (foreach breaks static scope). (Dmitry)
|
||||
- Fixed bug #37045 (Fixed check for special chars for http redirects). (Ilia)
|
||||
- Fixed bug #36857 (Added support for partial content fetching to the HTTP
|
||||
streams wrapper). (Ilia)
|
||||
- Fixed bug #36776 (node_list_wrapper_dtor segfault). (Rob)
|
||||
- Fixed bug #36459 (Incorrect adding PHPSESSID to links, which contains \r\n).
|
||||
(Ilia)
|
||||
- Fixed bug #36458 (sleep() accepts negative values). (Ilia)
|
||||
- Fixed bug #36242 (Possible memory corruption in stream_select()). (Tony)
|
||||
- Fixed bug #36223 (curl bypasses open_basedir restrictions). (Tony)
|
||||
- Fixed bug #36205 (Memory leaks on duplicate cookies). (Dmitry)
|
||||
- Fixed bug #36148 (unpack("H*hex", $data) is adding an extra character to the
|
||||
end of the string). (Ilia)
|
||||
- Fixed bug #36017 (fopen() crashes PHP when opening a URL). (Tony)
|
||||
|
||||
13 Jan 2006, Version 4.4.2
|
||||
- Added missing safe_mode/open_basedir checks into cURL extension. (Ilia)
|
||||
- Backported missing imap_mailcompose() fixes from PHP 5.x. (Ilia)
|
||||
- Prevent header injection by limiting each header to a single line. (Ilia)
|
||||
- Fixed possible XSS inside error reporting functionality. (Ilia)
|
||||
- Fixed Apache 2 regression with sub-request handling on non-linux systems.
|
||||
(Ilia, Tony)
|
||||
- Fixed bug #35817 (unpack() does not decode odd number of hexadecimal values).
|
||||
(Ilia)
|
||||
- Fixed bug #35735 ($EGREP not defined in configure). (Jani)
|
||||
@@ -20,23 +207,6 @@ PHP 4 NEWS
|
||||
properly). (Ilia)
|
||||
- Fixed bug #35341 (Fix for bug #33760 breaks build with older curl). (Tony)
|
||||
- Fixed bug #35278 (Multiple virtual() calls crash Apache 2 php module). (Ilia)
|
||||
- Fixed bug #35062 (socket_read() produces warnings on non blocking sockets).
|
||||
(Nuno, Ilia)
|
||||
- Fixed bug #34359 (Possible crash inside fopen http wrapper). (Ilia,Nuno,Sara)
|
||||
- Fixed bug #33523 (Memory leak in xmlrpc_encode_request()). (Ilia)
|
||||
- Fixed bug #33153 (crash in mssql_next result). (Frank)
|
||||
- Fixed bug #32009 (crash when mssql_bind() is called more than once). (Frank)
|
||||
- Fixed bug #33963 (mssql_bind() fails on input parameters). (Frank)
|
||||
- Fixed bug #33201 (Crash when fetching some data types). (Frank)
|
||||
- Fixed bug #30760 (Remove MessageBox on win32 for E_CORE errors if
|
||||
display_startup_error is off). (Ilia)
|
||||
- Fixed bug #27678 (number_format() crashes with large numbers). (Marcus)
|
||||
|
||||
18 Nov 2005, Version 4.4.2RC1
|
||||
- Added missing safe_mode/open_basedir checks into cURL extension. (Ilia)
|
||||
- Backported missing imap_mailcompose() fixes from PHP 5.x. (Ilia)
|
||||
- Fixed Apache 2 regression with sub-request handling on non-linux systems.
|
||||
(Ilia, Tony)
|
||||
- Fixed bug #35257 (Calling ob_flush after creating an ob callback causes
|
||||
segfault). (Tony)
|
||||
- Fixed bug #35079 (stream_set_blocking(true) toggles, not enables
|
||||
@@ -44,6 +214,8 @@ PHP 4 NEWS
|
||||
- Fixed bug #35078 (configure does not find ldap_start_tls_s). (Jani)
|
||||
- Fixed bug #35071 (Wrong fopen mode used in GD safe-mode checks). (Jani)
|
||||
- Fixed bug #35067, #35063 (key(),current() need to work by reference). (Ilia)
|
||||
- Fixed bug #35062 (socket_read() produces warnings on non blocking sockets).
|
||||
(Nuno, Ilia)
|
||||
- Fixed bug #35059 (Apache2 crash with mod_rewrite). (Ilia)
|
||||
- Fixed bug #35009 (ZTS: Persistent resource destruct crashes when extension
|
||||
is compiled as shared). (Dmitry)
|
||||
@@ -52,12 +224,21 @@ PHP 4 NEWS
|
||||
- Fixed bug #34851 (SO_RECVTIMEO and SO_SNDTIMEO socket options expect integer
|
||||
parameter on Windows). (Mike)
|
||||
- Fixed bug #34830 (the 5th argument of mb_send_mail does not work). (Rui)
|
||||
- Fixed bug #34359 (Possible crash inside fopen http wrapper). (Ilia,Nuno,Sara)
|
||||
- Fixed bug #33963 (mssql_bind() fails on input parameters). (Frank)
|
||||
- Fixed bug #33760 (cURL needs CRYPTO_callback functions to prevent locking).
|
||||
(Mike)
|
||||
- Fixed bug #33720 (mb_encode_mimeheader does not work for multibyte chars).
|
||||
(Rui)
|
||||
- Fixed bug #31971 (ftp_login fails on some SSL servers).
|
||||
- Fixed bug #33523 (Memory leak in xmlrpc_encode_request()). (Ilia)
|
||||
- Fixed bug #33201 (Crash when fetching some data types). (Frank)
|
||||
(frantisek at augusztin dot com)
|
||||
- Fixed bug #33153 (crash in mssql_next result). (Frank)
|
||||
- Fixed bug #32009 (crash when mssql_bind() is called more than once). (Frank)
|
||||
- Fixed bug #31971 (ftp_login fails on some SSL servers).
|
||||
- Fixed bug #30760 (Remove MessageBox on win32 for E_CORE errors if
|
||||
display_startup_error is off). (Ilia)
|
||||
- Fixed bug #27678 (number_format() crashes with large numbers). (Marcus)
|
||||
|
||||
31 Oct 2005, Version 4.4.1
|
||||
- Added missing safe_mode checks for image* functions and cURL. (Ilia)
|
||||
|
||||
+17
-7
@@ -29,14 +29,20 @@ Having said that, here are the organizational rules:
|
||||
5. If you don't know how to do something, ask first!
|
||||
|
||||
6. Test your changes before committing them. We mean it. Really.
|
||||
To do so use "make test".
|
||||
|
||||
7. For development use the --enable-maintainer-zts switch to ensure your
|
||||
code handles TSRM correctly and doesn't break for thos who need that.
|
||||
|
||||
Currently we have the following branches in use:
|
||||
HEAD Will become PHP 5.1. This CVS branch is for active development.
|
||||
PHP_5_0 Is used to release the PHP 5.0.x series. Only minor feature
|
||||
enhancements may go in here, but please keep that as infrequent as
|
||||
possible.
|
||||
PHP_4_3 Is used to release the PHP 4.3.x series. Only bugfixes are permitted
|
||||
on this branch.
|
||||
HEAD Will become PHP 6.0. This CVS branch is for active development.
|
||||
PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature
|
||||
enhancements may go in here, but please keep that as infrequent as
|
||||
possible.
|
||||
PHP_5_1 This branch is closed.
|
||||
PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
PHP_4_3 This branch is closed.
|
||||
|
||||
The next few rules are more of a technical nature.
|
||||
|
||||
@@ -92,9 +98,13 @@ For string.c:
|
||||
|
||||
The # lines will be omitted from the ChangeLog automagically.
|
||||
|
||||
Use the [DOC] tag in your log message whenever you feel that your changes
|
||||
imply a documentation modification. The php-doc team will automatically
|
||||
get notified about your commit through the php-doc mailing list.
|
||||
|
||||
If you fix some bugs, you should note the bug ID numbers in your
|
||||
commit message. Bug ID should be prefixed by "#" for easier access to
|
||||
bug report when developers are browsing CVS via. LXR or Bonsai.
|
||||
bug report when developers are browsing CVS via LXR or Bonsai.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+23
-4
@@ -13,7 +13,7 @@ AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[
|
||||
ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1)
|
||||
ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2)
|
||||
ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3)
|
||||
sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments
|
||||
test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_PROG_RE2C],[
|
||||
@@ -561,18 +561,37 @@ AC_DEFUN([PHP_CONFIG_NICE],[
|
||||
|
||||
EOF
|
||||
|
||||
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS CC CXX; do
|
||||
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
|
||||
eval val=\$$var
|
||||
if test -n "$val"; then
|
||||
echo "$var='$val' \\" >> $1
|
||||
fi
|
||||
done
|
||||
|
||||
for arg in [$]0 "[$]@"; do
|
||||
echo "'[$]arg' \\" >> $1
|
||||
echo "'[$]0' \\" >> $1
|
||||
if test `expr -- [$]0 : "'.*"` = 0; then
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]0'"
|
||||
else
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
|
||||
fi
|
||||
for arg in $ac_configure_args; do
|
||||
if test `expr -- $arg : "'.*"` = 0; then
|
||||
if test `expr -- $arg : "--.*"` = 0; then
|
||||
break;
|
||||
fi
|
||||
echo "'[$]arg' \\" >> $1
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'"
|
||||
else
|
||||
if test `expr -- $arg : "'--.*"` = 0; then
|
||||
break;
|
||||
fi
|
||||
echo "[$]arg \\" >> $1
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]arg"
|
||||
fi
|
||||
done
|
||||
echo '"[$]@"' >> $1
|
||||
chmod +x $1
|
||||
PHP_SUBST_OLD(CONFIGURE_COMMAND)
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_TIME_R_TYPE],[
|
||||
|
||||
+615
-19
@@ -1,13 +1,13 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
## GNU shtool -- The GNU Portable Shell Tool
|
||||
## Copyright (c) 1994-2005 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Copyright (c) 1994-2006 Ralf S. Engelschall <rse@engelschall.com>
|
||||
##
|
||||
## See http://www.gnu.org/software/shtool/ for more information.
|
||||
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
|
||||
##
|
||||
## Version: 2.0.2 (15-Jun-2005)
|
||||
## Contents: 4/19 available modules
|
||||
## Version: 2.0.6 (19-Apr-2006)
|
||||
## Contents: 5/19 available modules
|
||||
##
|
||||
|
||||
##
|
||||
@@ -41,6 +41,7 @@
|
||||
## echo Print string with optional construct expansion
|
||||
## install Install a program, script or datafile
|
||||
## mkdir Make one or more directories
|
||||
## platform Platform Identification Utility
|
||||
## path Deal with program paths
|
||||
##
|
||||
## Not available commands (because module was not built-in):
|
||||
@@ -54,24 +55,48 @@
|
||||
## rotate Logfile rotation
|
||||
## tarball Roll distribution tarballs
|
||||
## subst Apply sed(1) substitution operations
|
||||
## platform Platform Identification Utility
|
||||
## arx Extended archive command
|
||||
## slo Separate linker options by library class
|
||||
## scpp Sharing C Pre-Processor
|
||||
## version Maintain a version information file
|
||||
##
|
||||
|
||||
# maximum Bourne-Shell compatibility
|
||||
if [ ".$ZSH_VERSION" != . ] && (emulate sh) >/dev/null 2>&1; then
|
||||
# reconfigure zsh(1)
|
||||
emulate sh
|
||||
NULLCMD=:
|
||||
alias -g '${1+"$@"}'='"$@"'
|
||||
elif [ ".$BASH_VERSION" != . ] && (set -o posix) >/dev/null 2>&1; then
|
||||
# reconfigure bash(1)
|
||||
set -o posix
|
||||
fi
|
||||
|
||||
# maximum independence of NLS nuisances
|
||||
for var in \
|
||||
LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
|
||||
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
|
||||
LC_TELEPHONE LC_TIME
|
||||
do
|
||||
if (set +x; test -z "`(eval $var=C; export $var) 2>&1`"); then
|
||||
eval $var=C; export $var
|
||||
else
|
||||
unset $var
|
||||
fi
|
||||
done
|
||||
|
||||
# initial command line handling
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "$0:Error: invalid command line" 1>&2
|
||||
echo "$0:Hint: run \`$0 -h' for usage" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
|
||||
echo "This is GNU shtool, version 2.0.2 (15-Jun-2005)"
|
||||
echo "Copyright (c) 1994-2005 Ralf S. Engelschall <rse@engelschall.com>"
|
||||
echo "Report bugs to <bug-shtool@gnu.org>"
|
||||
echo "This is GNU shtool, version 2.0.6 (19-Apr-2006)"
|
||||
echo 'Copyright (c) 1994-2006 Ralf S. Engelschall <rse@engelschall.com>'
|
||||
echo 'Report bugs to <bug-shtool@gnu.org>'
|
||||
echo ''
|
||||
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
|
||||
echo 'Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]'
|
||||
echo ''
|
||||
echo 'Available global <options>:'
|
||||
echo ' -v, --version display shtool version information'
|
||||
@@ -88,6 +113,10 @@ if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
|
||||
echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode'
|
||||
echo ' <mode>] [-o|--owner <owner>] [-g|--group <group>] <dir>'
|
||||
echo ' [<dir> ...]'
|
||||
echo ' platform [-F|--format <format>] [-S|--sep <string>] [-C|--conc'
|
||||
echo ' <string>] [-L|--lower] [-U|--upper] [-v|--verbose]'
|
||||
echo ' [-c|--concise] [-n|--no-newline] [-t|--type <type>]'
|
||||
echo ' [-V|--version] [-h|--help]'
|
||||
echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]'
|
||||
echo ' [-m|--magic] [-p|--path <path>] <str> [<str> ...]'
|
||||
echo ''
|
||||
@@ -117,10 +146,6 @@ if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
|
||||
echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup'
|
||||
echo ' <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>]'
|
||||
echo ' [...]'
|
||||
echo ' platform [-F|--format <format>] [-S|--sep <string>] [-C|--conc'
|
||||
echo ' <string>] [-L|--lower] [-U|--upper] [-v|--verbose]'
|
||||
echo ' [-c|--concise] [-n|--no-newline] [-t|--type <type>]'
|
||||
echo ' [-V|--version] [-h|--help]'
|
||||
echo ' arx [-t|--trace] [-C|--command <cmd>] <op> <archive> [<file>'
|
||||
echo ' ...]'
|
||||
echo ' slo [-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib>'
|
||||
@@ -136,11 +161,11 @@ if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
|
||||
exit 0
|
||||
fi
|
||||
if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then
|
||||
echo "GNU shtool 2.0.2 (15-Jun-2005)"
|
||||
echo "GNU shtool 2.0.6 (19-Apr-2006)"
|
||||
exit 0
|
||||
fi
|
||||
if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then
|
||||
shtoolize -oshtool echo install mkdir path
|
||||
shtoolize -oshtool echo install mkdir platform path
|
||||
exit 0
|
||||
fi
|
||||
if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then
|
||||
@@ -149,7 +174,7 @@ if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then
|
||||
fi
|
||||
name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
|
||||
case "$name" in
|
||||
echo|install|mkdir|path )
|
||||
echo|install|mkdir|platform|path )
|
||||
# implicit tool command selection
|
||||
tool="$name"
|
||||
;;
|
||||
@@ -207,6 +232,24 @@ case $tool in
|
||||
opt_o=""
|
||||
opt_g=""
|
||||
;;
|
||||
platform )
|
||||
str_tool="platform"
|
||||
str_usage="[-F|--format <format>] [-S|--sep <string>] [-C|--conc <string>] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type <type>] [-V|--version] [-h|--help]"
|
||||
arg_spec="0="
|
||||
opt_spec="F:S:C:L.U.v.c.n.t:d.V.h."
|
||||
opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help"
|
||||
opt_F="%{sp} (%{ap})"
|
||||
opt_S=" "
|
||||
opt_C="/"
|
||||
opt_L=no
|
||||
opt_U=no
|
||||
opt_t=""
|
||||
opt_v=no
|
||||
opt_c=no
|
||||
opt_n=no
|
||||
opt_V=no
|
||||
opt_h=no
|
||||
;;
|
||||
path )
|
||||
str_tool="path"
|
||||
str_usage="[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path <path>] <str> [<str> ...]"
|
||||
@@ -430,7 +473,7 @@ case $tool in
|
||||
echo )
|
||||
##
|
||||
## echo -- Print string with optional construct expansion
|
||||
## Copyright (c) 1998-2005 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Copyright (c) 1998-2006 Ralf S. Engelschall <rse@engelschall.com>
|
||||
##
|
||||
|
||||
text="$*"
|
||||
@@ -728,7 +771,7 @@ echo )
|
||||
install )
|
||||
##
|
||||
## install -- Install a program, script or datafile
|
||||
## Copyright (c) 1997-2005 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Copyright (c) 1997-2006 Ralf S. Engelschall <rse@engelschall.com>
|
||||
##
|
||||
|
||||
# special case: "shtool install -d <dir> [...]" internally
|
||||
@@ -891,7 +934,7 @@ install )
|
||||
mkdir )
|
||||
##
|
||||
## mkdir -- Make one or more directories
|
||||
## Copyright (c) 1996-2005 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Copyright (c) 1996-2006 Ralf S. Engelschall <rse@engelschall.com>
|
||||
##
|
||||
|
||||
errstatus=0
|
||||
@@ -976,10 +1019,563 @@ mkdir )
|
||||
shtool_exit $errstatus
|
||||
;;
|
||||
|
||||
platform )
|
||||
##
|
||||
## platform -- Platform Identification Utility
|
||||
## Copyright (c) 2003-2006 Ralf S. Engelschall <rse@engelschall.com>
|
||||
##
|
||||
|
||||
# option post-processing
|
||||
if [ ".$opt_t" != . ]; then
|
||||
case "$opt_t" in
|
||||
binary )
|
||||
# binary package id (OpenPKG RPM)
|
||||
opt_F="%<ap>-%<sp>"
|
||||
opt_L=yes
|
||||
opt_S=""
|
||||
opt_C="+"
|
||||
;;
|
||||
build )
|
||||
# build time checking (OpenPKG RPM)
|
||||
opt_F="%<at>-%<st>"
|
||||
opt_L=yes
|
||||
opt_S=""
|
||||
opt_C="+"
|
||||
;;
|
||||
gnu )
|
||||
# GNU config.guess style <arch>-<vendor>-<os><osversion>
|
||||
opt_F="%<at>-unknown-%<st>"
|
||||
opt_L=yes
|
||||
opt_S=""
|
||||
opt_C="+"
|
||||
;;
|
||||
web )
|
||||
# non-whitespace HTTP Server-header id
|
||||
opt_F="%<sp>-%<ap>"
|
||||
opt_S="/"
|
||||
opt_C="+"
|
||||
;;
|
||||
summary)
|
||||
# human readable verbose summary information
|
||||
opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])"
|
||||
opt_S=" "
|
||||
opt_C="/"
|
||||
;;
|
||||
all-in-one )
|
||||
# full-table all-in-one information
|
||||
opt_F=""
|
||||
opt_F="${opt_F}concise architecture class: %<ac>\\n"
|
||||
opt_F="${opt_F}regular architecture class: %{ac}\\n"
|
||||
opt_F="${opt_F}verbose architecture class: %[ac]\\n"
|
||||
opt_F="${opt_F}concise architecture product: %<ap>\\n"
|
||||
opt_F="${opt_F}regular architecture product: %{ap}\\n"
|
||||
opt_F="${opt_F}verbose architecture product: %[ap]\\n"
|
||||
opt_F="${opt_F}concise architecture technology: %<at>\\n"
|
||||
opt_F="${opt_F}regular architecture technology: %{at}\\n"
|
||||
opt_F="${opt_F}verbose architecture technology: %[at]\\n"
|
||||
opt_F="${opt_F}concise system class: %<sc>\\n"
|
||||
opt_F="${opt_F}regular system class: %{sc}\\n"
|
||||
opt_F="${opt_F}verbose system class: %[sc]\\n"
|
||||
opt_F="${opt_F}concise system product: %<sp>\\n"
|
||||
opt_F="${opt_F}regular system product: %{sp}\\n"
|
||||
opt_F="${opt_F}verbose system product: %[sp]\\n"
|
||||
opt_F="${opt_F}concise system technology: %<st>\\n"
|
||||
opt_F="${opt_F}regular system technology: %{st}\\n"
|
||||
opt_F="${opt_F}verbose system technology: %[st]"
|
||||
;;
|
||||
* )
|
||||
echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# assemble initial platform information
|
||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\
|
||||
UNAME_MACHINE='unknown'
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\
|
||||
UNAME_SYSTEM='unknown'
|
||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\
|
||||
UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\
|
||||
UNAME_RELEASE='unknown'
|
||||
|
||||
UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}"
|
||||
|
||||
AC=""; AP=""; AT=""
|
||||
SC=""; SP=""; ST=""
|
||||
|
||||
# dispatch into platform specific sections
|
||||
case "${UNAME}" in
|
||||
|
||||
# FreeBSD
|
||||
*:FreeBSD:* )
|
||||
# determine architecture
|
||||
AC="${UNAME_MACHINE}"
|
||||
case "${AC}" in
|
||||
i386 ) AC="iX86" ;;
|
||||
esac
|
||||
AP="${AC}"
|
||||
AT="${AP}"
|
||||
if [ ".${AT}" = ".iX86" ]; then
|
||||
case "`(/sbin/sysctl -n hw.model) 2>&1`" in
|
||||
*"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;;
|
||||
*"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;;
|
||||
*"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;;
|
||||
esac
|
||||
fi
|
||||
# determine system
|
||||
r=`echo "${UNAME_RELEASE}" |\
|
||||
sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'`
|
||||
ST="FreeBSD ${r}"
|
||||
SP="${ST}"
|
||||
case "${r}" in
|
||||
1.* ) SC="4.3BSD" ;;
|
||||
* ) SC="4.4BSD" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
# NetBSD
|
||||
*:NetBSD:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
AP="${AT}"
|
||||
case "${AP}" in
|
||||
i[3-6]86 ) AP="iX86" ;;
|
||||
esac
|
||||
AC="${AP}"
|
||||
# determine system
|
||||
r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
|
||||
ST="NetBSD ${r}"
|
||||
SP="${ST}"
|
||||
case "${r}" in
|
||||
0.* ) SC="4.3BSD" ;;
|
||||
* ) SC="4.4BSD" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
# OpenBSD
|
||||
*:OpenBSD:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
AP="${AT}"
|
||||
case "${AP}" in
|
||||
i[3-6]86 ) AP="iX86" ;;
|
||||
esac
|
||||
AC="${AP}"
|
||||
# determine system
|
||||
r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
|
||||
ST="OpenBSD ${r}"
|
||||
SP="${ST}"
|
||||
SC="4.4BSD"
|
||||
;;
|
||||
|
||||
# GNU/Linux
|
||||
*:Linux:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
case "${AT}" in
|
||||
ia64 ) AT="IA64" ;;
|
||||
x86_64 ) AT='AMD64' ;;
|
||||
parisc ) AT="HPPA32" ;;
|
||||
parisc64 ) AT="HPPA64" ;;
|
||||
esac
|
||||
AP="${AT}"
|
||||
case "${AP}" in
|
||||
i[3-6]86 ) AP='iX86' ;;
|
||||
esac
|
||||
AC="${AP}"
|
||||
# determine system
|
||||
v_kern=`echo "${UNAME_RELEASE}" |\
|
||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
|
||||
v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\
|
||||
env -i sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null`
|
||||
ST="GNU/<Linux >${v_libc}/<${v_kern}>"
|
||||
if [ -f /etc/lsb-release ]; then
|
||||
eval `( . /etc/lsb-release
|
||||
echo "SC=\"LSB${LSB_VERSION}\""
|
||||
if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then
|
||||
echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\""
|
||||
fi
|
||||
) 2>/dev/null`
|
||||
fi
|
||||
if [ ".$SP" = . ]; then
|
||||
for tagfile in x \
|
||||
`cd /etc && \
|
||||
/bin/ls *[_-]release *[_-]version 2>/dev/null | env -i sort | \
|
||||
sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \
|
||||
echo redhat-release lsb-release`
|
||||
do
|
||||
[ ".${tagfile}" = .x ] && continue
|
||||
[ ! -f "/etc/${tagfile}" ] && continue
|
||||
n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
|
||||
v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\
|
||||
sed -e 's/^/#/' \
|
||||
-e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
|
||||
-e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
|
||||
-e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
|
||||
-e 's/^#.*$//'`
|
||||
case "`util_lower ${n}`" in
|
||||
redhat )
|
||||
if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then
|
||||
n="<R>ed <H>at <E>nterprise <L>inux"
|
||||
else
|
||||
n="<R>ed <H>at <L>inux"
|
||||
fi
|
||||
;;
|
||||
debian ) n="Debian[ GNU/Linux]" ;;
|
||||
ubuntu ) n="Ubuntu[ GNU/Linux]" ;;
|
||||
fedora ) n="<Fedora> Core[ GNU/Linux]" ;;
|
||||
suse ) n="SuSE[ Linux]" ;;
|
||||
mandrake*|mandriva ) n="Mandriva[ Linux]" ;;
|
||||
gentoo ) n="Gentoo[ GNU/Linux]" ;;
|
||||
slackware ) n="Slackware[ Linux]" ;;
|
||||
turbolinux ) n="TurboLinux" ;;
|
||||
unitedlinux ) n="UnitedLinux" ;;
|
||||
* ) n="${n}[ GNU/Linux]" ;;
|
||||
esac
|
||||
case "$n" in
|
||||
*"<"*">"* ) SP="$n <$v>" ;;
|
||||
* ) SP="$n $v" ;;
|
||||
esac
|
||||
break
|
||||
done
|
||||
fi
|
||||
[ ".$SP" = . ] && SP="${ST}"
|
||||
[ ".$SC" = . ] && SC="LSB"
|
||||
;;
|
||||
|
||||
# Sun Solaris
|
||||
*:SunOS:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
case "${AT}" in
|
||||
i86pc )
|
||||
AT="iX86"
|
||||
case "`(/bin/isainfo -k) 2>&1`" in
|
||||
amd64 ) AT="AMD64" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
AP="${AT}"
|
||||
case "${AP}" in
|
||||
sun4[cdm] ) AP="SPARC32" ;;
|
||||
sun4[uv] ) AP="SPARC64" ;;
|
||||
sun4* ) AP="SPARC" ;;
|
||||
esac
|
||||
AC="${AP}"
|
||||
case "${AC}" in
|
||||
SPARC* ) AC="SPARC" ;;
|
||||
esac
|
||||
# determine system
|
||||
ST="[Sun ]SunOS ${UNAME_RELEASE}"
|
||||
v=`echo "${UNAME_RELEASE}" |\
|
||||
sed -e 's;^4\.;1.;' \
|
||||
-e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \
|
||||
-e 's;^5\.\([0-9][0-9]*\).*;\1;'`
|
||||
SP="[Sun ]Solaris $v"
|
||||
case "${UNAME_RELEASE}" in
|
||||
4.* ) SC="4.3BSD" ;;
|
||||
5.* ) SC="SVR4" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
# SCO UnixWare
|
||||
*:UnixWare:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
case "${AT}" in
|
||||
i[3-6]86 | ix86at ) AT="iX86" ;;
|
||||
esac
|
||||
AP="${AT}"
|
||||
# determine system
|
||||
v=`/sbin/uname -v`
|
||||
ST="[SCO ]UnixWare ${v}"
|
||||
SP="${ST}"
|
||||
SC="SVR${UNAME_RELEASE}"
|
||||
;;
|
||||
|
||||
# QNX
|
||||
*:QNX:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
case "${AT}" in
|
||||
x86pc ) AT="iX86" ;;
|
||||
esac
|
||||
AP="${AT}"
|
||||
# determine system
|
||||
v="${UNAME_RELEASE}"
|
||||
ST="QNX[ Neutrino RTOS] ${v}"
|
||||
v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'`
|
||||
SP="QNX[ Neutrino RTOS] ${v}"
|
||||
SC="QNX"
|
||||
;;
|
||||
|
||||
# SGI IRIX
|
||||
*:IRIX*:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
AP="${AT}"
|
||||
case "${AP}:${UNAME_SYSTEM}" in
|
||||
IP*:IRIX64 ) AP="MIPS64" ;;
|
||||
IP*:* ) AP="MIPS" ;;
|
||||
esac
|
||||
AC="${AP}"
|
||||
# determine system
|
||||
v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'`
|
||||
ST="[SGI ]IRIX ${v}"
|
||||
v="${UNAME_RELEASE}"
|
||||
SP="[SGI ]IRIX ${v}"
|
||||
SC="4.2BSD/SVR3"
|
||||
;;
|
||||
|
||||
# HP HP-UX
|
||||
*:HP-UX:* )
|
||||
# determine architecture
|
||||
AT="${UNAME_MACHINE}"
|
||||
case "${AT}" in
|
||||
ia64 ) AT="IA64" ;;
|
||||
9000/[34]?? ) AT=M68K ;;
|
||||
9000/[678][0-9][0-9])
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523 ) AT="HPPA1.0" ;;
|
||||
528 ) AT="HPPA1.1" ;;
|
||||
532 ) AT="HPPA2.0"
|
||||
case "${sc_kernel_bits}" in
|
||||
32 ) AT="${AT}n" ;;
|
||||
64 ) AT="${AT}w" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
AP="${AT}"
|
||||
case "${AP}" in
|
||||
HPPA* ) AP="HPPA" ;;
|
||||
esac
|
||||
AC="${AP}"
|
||||
# determine system
|
||||
v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'`
|
||||
ST="[HP ]<HP>-<UX ${v}>"
|
||||
SP="${ST}"
|
||||
case "${v}" in
|
||||
10.* ) SC="SVR4.2" ;;
|
||||
[7-9]* ) SC="SVR4" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
# HP Tru64 (OSF1)
|
||||
*:OSF1:* )
|
||||
# determine architecture
|
||||
AP="${UNAME_MACHINE}"
|
||||
case "${AP}" in
|
||||
alpha ) AP="Alpha" ;;
|
||||
esac
|
||||
alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\
|
||||
sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'`
|
||||
AT="${AP}${alpha_type}"
|
||||
AC="${AP}"
|
||||
# determine system
|
||||
v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'`
|
||||
ST="[HP ]Tru64 ${v}"
|
||||
SP="${ST}"
|
||||
SC="OSF1"
|
||||
;;
|
||||
|
||||
# IBM AIX
|
||||
*:AIX:* )
|
||||
cpu_arch=rs6000
|
||||
if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
|
||||
cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then
|
||||
cpu_arch=powerpc
|
||||
fi
|
||||
elif [ -d /QOpenSys ]; then
|
||||
# IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment)
|
||||
cpu_arch=powerpc
|
||||
fi
|
||||
if [ -x /usr/bin/oslevel ]; then
|
||||
os_level=`/usr/bin/oslevel`
|
||||
else
|
||||
os_level="`uname -v`.`uname -r`"
|
||||
fi
|
||||
os_level=`echo "${os_level}" |\
|
||||
sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \
|
||||
-e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'`
|
||||
AT="${cpu_arch}"
|
||||
AP="${AT}"
|
||||
AC="${AP}"
|
||||
ST="[IBM ]<AIX >${os_level}"
|
||||
SP="${ST}"
|
||||
case "${os_level}" in
|
||||
[12]* ) SC="SVR2" ;;
|
||||
* ) SC="SVR4" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
# Apple MacOS X Darwin
|
||||
*:Darwin:* )
|
||||
AT=`uname -p`
|
||||
case "${AT}" in
|
||||
powerpc ) AT="PPC" ;;
|
||||
esac
|
||||
AP="${AT}"
|
||||
AC="${AP}"
|
||||
case "${AC}" in
|
||||
i?86 ) AC="iX86" ;;
|
||||
esac
|
||||
ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}"
|
||||
SP="${ST}"
|
||||
SC="4.4BSD/Mach3"
|
||||
;;
|
||||
|
||||
# TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
|
||||
# *:XXX:* )
|
||||
# ...
|
||||
# ;;
|
||||
|
||||
# ...A STILL UNKNOWN PLATFORM...
|
||||
* )
|
||||
AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"`
|
||||
AP="${AT}"
|
||||
AC="${AP}"
|
||||
v=`echo "${UNAME_RELEASE}" |\
|
||||
sed -e 's/^/#/' \
|
||||
-e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
|
||||
-e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
|
||||
-e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
|
||||
-e 's/^#.*$/?/'`
|
||||
ST="${UNAME_SYSTEM} ${v}"
|
||||
SP="${ST}"
|
||||
SC="${SP}"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# provide fallback values
|
||||
[ ".$AT" = . ] && AT="${AP:-${AC}}"
|
||||
[ ".$AP" = . ] && AP="${AT:-${AC}}"
|
||||
[ ".$AC" = . ] && AC="${AP:-${AT}}"
|
||||
[ ".$ST" = . ] && ST="${SP:-${SC}}"
|
||||
[ ".$SP" = . ] && SP="${ST:-${SC}}"
|
||||
[ ".$SC" = . ] && SC="${SP:-${ST}}"
|
||||
|
||||
# support explicit enforced verbose/concise output
|
||||
if [ ".$opt_v" = .yes ]; then
|
||||
opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'`
|
||||
elif [ ".$opt_c" = .yes ]; then
|
||||
opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'`
|
||||
fi
|
||||
|
||||
# provide verbose and concise variants
|
||||
AC_V=""; AC_N=""; AC_C=""
|
||||
AP_V=""; AP_N=""; AP_C=""
|
||||
AT_V=""; AT_N=""; AT_C=""
|
||||
SC_V=""; SC_N=""; SC_C=""
|
||||
SP_V=""; SP_N=""; SP_C=""
|
||||
ST_V=""; ST_N=""; ST_C=""
|
||||
for var_lc in at ap ac st sp sc; do
|
||||
case "$opt_F" in
|
||||
*"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* )
|
||||
var_uc=`util_upper "$var_lc"`
|
||||
eval "val=\"\$${var_uc}\""
|
||||
val_V=""; val_N=""; val_C=""
|
||||
case "$opt_F" in
|
||||
*"%[${var_lc}]"* )
|
||||
val_V=`echo ":$val" | \
|
||||
sed -e 's/^://' \
|
||||
-e 's;\[\([^]]*\)\];\1;g' \
|
||||
-e 's;<\([^>]*\)>;\1;g' \
|
||||
-e "s; ;§§;g" \
|
||||
-e "s;/;%%;g" \
|
||||
-e "s;§§;${opt_S};g" \
|
||||
-e "s;%%;${opt_C};g"`
|
||||
eval "${var_uc}_V=\"\${val_V}\""
|
||||
;;
|
||||
esac
|
||||
case "$opt_F" in
|
||||
*"%{${var_lc}}"* | *"%${var_lc}"* )
|
||||
val_N=`echo ":$val" | \
|
||||
sed -e 's/^://' \
|
||||
-e 's;\[\([^]]*\)\];;g' \
|
||||
-e 's;<\([^>]*\)>;\1;g' \
|
||||
-e "s; ;§§;g" \
|
||||
-e "s;/;%%;g" \
|
||||
-e "s;§§;${opt_S};g" \
|
||||
-e "s;%%;${opt_C};g"`
|
||||
eval "${var_uc}_N=\"\${val_N}\""
|
||||
;;
|
||||
esac
|
||||
case "$opt_F" in
|
||||
*"%<${var_lc}>"* )
|
||||
val_C=`echo ":$val" | \
|
||||
sed -e 's/^://' \
|
||||
-e 's;\[\([^]]*\)\];;g' \
|
||||
-e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \
|
||||
-e "s; ;§§;g" \
|
||||
-e "s;/;%%;g" \
|
||||
-e "s;§§;${opt_S};g" \
|
||||
-e "s;%%;${opt_C};g"`
|
||||
eval "${var_uc}_C=\"\${val_C}\""
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# create output string
|
||||
output=`echo ":$opt_F" |\
|
||||
sed -e "s/^://" \
|
||||
-e "s;%\\[ac\\];${AC_V};g" \
|
||||
-e "s;%{ac};${AC_N};g" \
|
||||
-e "s;%ac;${AC_N};g" \
|
||||
-e "s;%<ac>;${AC_C};g" \
|
||||
-e "s;%\\[ap\\];${AP_V};g" \
|
||||
-e "s;%{ap};${AP_N};g" \
|
||||
-e "s;%ap;${AP_N};g" \
|
||||
-e "s;%<ap>;${AP_C};g" \
|
||||
-e "s;%\\[at\\];${AT_V};g" \
|
||||
-e "s;%{at};${AT_N};g" \
|
||||
-e "s;%at;${AT_N};g" \
|
||||
-e "s;%<at>;${AT_C};g" \
|
||||
-e "s;%\\[sc\\];${SC_V};g" \
|
||||
-e "s;%{sc};${SC_N};g" \
|
||||
-e "s;%sc;${SC_N};g" \
|
||||
-e "s;%<sc>;${SC_C};g" \
|
||||
-e "s;%\\[sp\\];${SP_V};g" \
|
||||
-e "s;%{sp};${SP_N};g" \
|
||||
-e "s;%sp;${SP_N};g" \
|
||||
-e "s;%<sp>;${SP_C};g" \
|
||||
-e "s;%\\[st\\];${ST_V};g" \
|
||||
-e "s;%{st};${ST_N};g" \
|
||||
-e "s;%st;${ST_N};g" \
|
||||
-e "s;%<st>;${ST_C};g" \
|
||||
-e 's/\\\\n/^/g' |\
|
||||
tr '^' '\012'`
|
||||
|
||||
# support lower/upper-case mapping
|
||||
if [ ".$opt_L" = .yes ]; then
|
||||
output=`util_lower "$output"`
|
||||
elif [ ".$opt_U" = .yes ]; then
|
||||
output=`util_upper "$output"`
|
||||
fi
|
||||
|
||||
# display output string
|
||||
if [ ".$opt_n" = .yes ]; then
|
||||
echo . | awk '{ printf("%s", output); }' output="$output"
|
||||
else
|
||||
echo "$output"
|
||||
fi
|
||||
|
||||
shtool_exit 0
|
||||
;;
|
||||
|
||||
path )
|
||||
##
|
||||
## path -- Deal with program paths
|
||||
## Copyright (c) 1998-2005 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Copyright (c) 1998-2006 Ralf S. Engelschall <rse@engelschall.com>
|
||||
##
|
||||
|
||||
namelist="$*"
|
||||
|
||||
+12
-5
@@ -31,17 +31,14 @@ AC_PREREQ(2.13)
|
||||
AC_INIT(README.CVS-RULES)
|
||||
|
||||
PHP_CONFIG_NICE(config.nice)
|
||||
for arg in $0 "$@"; do
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
|
||||
done
|
||||
|
||||
PHP_CANONICAL_HOST
|
||||
AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
MAJOR_VERSION=4
|
||||
MINOR_VERSION=4
|
||||
RELEASE_VERSION=2
|
||||
EXTRA_VERSION="RC2"
|
||||
RELEASE_VERSION=9
|
||||
EXTRA_VERSION=""
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
@@ -1048,6 +1045,15 @@ if test -z "$EXTENSION_DIR"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
case $PHP_LAYOUT in
|
||||
GNU)
|
||||
datarootdir=$prefix/share
|
||||
;;
|
||||
*)
|
||||
datarootdir=$prefix/php
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Expand all directory names for use in macros/constants
|
||||
EXPANDED_PEAR_INSTALLDIR=`eval echo $PEAR_INSTALLDIR`
|
||||
EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR`
|
||||
@@ -1138,6 +1144,7 @@ PHP_SUBST(phptempdir)
|
||||
PHP_SUBST(prefix)
|
||||
PHP_SUBST(localstatedir)
|
||||
PHP_SUBST(datadir)
|
||||
PHP_SUBST(datarootdir)
|
||||
PHP_SUBST(sysconfdir)
|
||||
|
||||
PHP_SUBST(AWK)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+7
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -171,6 +171,10 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
|
||||
#else
|
||||
path_copy = path;
|
||||
#endif
|
||||
|
||||
if ((PG(safe_mode) && (!php_checkuid(path_copy, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(path_copy TSRMLS_CC)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* try and open it directly first */
|
||||
bz_file = BZ2_bzopen(path_copy, mode);
|
||||
@@ -182,7 +186,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
|
||||
|
||||
if (bz_file == NULL) {
|
||||
/* that didn't work, so try and get something from the network/wrapper */
|
||||
stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path);
|
||||
stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST | ENFORCE_SAFE_MODE, opened_path);
|
||||
|
||||
if (stream) {
|
||||
int fd;
|
||||
@@ -269,7 +273,7 @@ PHP_FUNCTION(bzread)
|
||||
|
||||
php_stream_from_zval(stream, &bz);
|
||||
|
||||
if (len < 0) {
|
||||
if ((len + 1) < 1) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+162
-137
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -48,13 +48,11 @@
|
||||
/* {{{ cruft for thread safe SSL crypto locks */
|
||||
#if defined(ZTS) && defined(HAVE_CURL_SSL)
|
||||
# ifdef PHP_WIN32
|
||||
# define PHP_CURL_NEED_SSL_TSL
|
||||
# define PHP_CURL_NEED_OPENSSL_TSL
|
||||
# include <openssl/crypto.h>
|
||||
# else /* !PHP_WIN32 */
|
||||
# if defined(HAVE_CURL_OPENSSL)
|
||||
# if defined(HAVE_OPENSSL_CRYPTO_H)
|
||||
# define PHP_CURL_NEED_SSL_TSL
|
||||
# define PHP_CURL_NEED_OPENSSL_TSL
|
||||
# include <openssl/crypto.h>
|
||||
# else
|
||||
@@ -65,7 +63,6 @@
|
||||
# endif
|
||||
# elif defined(HAVE_CURL_GNUTLS)
|
||||
# if defined(HAVE_GCRYPT_H)
|
||||
# define PHP_CURL_NEED_SSL_TSL
|
||||
# define PHP_CURL_NEED_GNUTLS_TSL
|
||||
# include <gcrypt.h>
|
||||
# else
|
||||
@@ -87,6 +84,7 @@
|
||||
#define SMART_STR_PREALLOC 4096
|
||||
|
||||
#include "ext/standard/php_smart_str.h"
|
||||
#include "ext/standard/php_string.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "ext/standard/file.h"
|
||||
#include "ext/standard/url.h"
|
||||
@@ -95,10 +93,61 @@
|
||||
static int le_curl;
|
||||
#define le_curl_name "cURL handle"
|
||||
|
||||
#ifdef PHP_CURL_NEED_SSL_TSL
|
||||
static inline void php_curl_ssl_init(void);
|
||||
static inline void php_curl_ssl_cleanup(void);
|
||||
#ifdef PHP_CURL_NEED_OPENSSL_TSL /* {{{ */
|
||||
static MUTEX_T *php_curl_openssl_tsl = NULL;
|
||||
|
||||
static void php_curl_ssl_lock(int mode, int n, const char * file, int line)
|
||||
{
|
||||
if (mode & CRYPTO_LOCK) {
|
||||
tsrm_mutex_lock(php_curl_openssl_tsl[n]);
|
||||
} else {
|
||||
tsrm_mutex_unlock(php_curl_openssl_tsl[n]);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned long php_curl_ssl_id(void)
|
||||
{
|
||||
return (unsigned long) tsrm_thread_id();
|
||||
}
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
#ifdef PHP_CURL_NEED_GNUTLS_TSL /* {{{ */
|
||||
static int php_curl_ssl_mutex_create(void **m)
|
||||
{
|
||||
if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) {
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
static int php_curl_ssl_mutex_destroy(void **m)
|
||||
{
|
||||
tsrm_mutex_free(*((MUTEX_T *) m));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static int php_curl_ssl_mutex_lock(void **m)
|
||||
{
|
||||
return tsrm_mutex_lock(*((MUTEX_T *) m));
|
||||
}
|
||||
|
||||
static int php_curl_ssl_mutex_unlock(void **m)
|
||||
{
|
||||
return tsrm_mutex_unlock(*((MUTEX_T *) m));
|
||||
}
|
||||
|
||||
static struct gcry_thread_cbs php_curl_gnutls_tsl = {
|
||||
GCRY_THREAD_OPTION_USER,
|
||||
NULL,
|
||||
php_curl_ssl_mutex_create,
|
||||
php_curl_ssl_mutex_destroy,
|
||||
php_curl_ssl_mutex_lock,
|
||||
php_curl_ssl_mutex_unlock
|
||||
};
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
|
||||
|
||||
@@ -111,14 +160,20 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
|
||||
|
||||
#define PHP_CURL_CHECK_OPEN_BASEDIR(str, len) \
|
||||
if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && \
|
||||
strncasecmp(str, "file://", sizeof("file://") - 1) == 0) \
|
||||
strncasecmp(str, "file:", sizeof("file:") - 1) == 0) \
|
||||
{ \
|
||||
php_url *tmp_url; \
|
||||
\
|
||||
\
|
||||
if (!(tmp_url = php_url_parse_ex(str, len))) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid url '%s'", str); \
|
||||
RETURN_FALSE; \
|
||||
} \
|
||||
\
|
||||
if (tmp_url->host || !php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Url '%s' contains unencoded control characters.", str); \
|
||||
php_url_free(tmp_url); \
|
||||
RETURN_FALSE; \
|
||||
} \
|
||||
\
|
||||
if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \
|
||||
(PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM)) \
|
||||
@@ -204,7 +259,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_NETRC);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
|
||||
#if CURLOPT_FTPASCII != 0
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
|
||||
#endif
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_PUT);
|
||||
#if CURLOPT_MUTE != 0
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_MUTE);
|
||||
@@ -242,7 +299,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FILETIME);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_READFUNCTION);
|
||||
#if CURLOPT_PASSWDFUNCTION != 0
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_PASSWDFUNCTION);
|
||||
#endif
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_HEADERFUNCTION);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_MAXREDIRS);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_MAXCONNECTS);
|
||||
@@ -408,8 +467,22 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_0);
|
||||
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_1);
|
||||
|
||||
#ifdef PHP_CURL_NEED_SSL_TSL
|
||||
php_curl_ssl_init();
|
||||
#ifdef PHP_CURL_NEED_OPENSSL_TSL
|
||||
{
|
||||
int i, c = CRYPTO_num_locks();
|
||||
|
||||
php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
|
||||
|
||||
for (i = 0; i < c; ++i) {
|
||||
php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
|
||||
}
|
||||
|
||||
CRYPTO_set_id_callback(php_curl_ssl_id);
|
||||
CRYPTO_set_locking_callback(php_curl_ssl_lock);
|
||||
}
|
||||
#endif
|
||||
#ifdef PHP_CURL_NEED_GNUTLS_TSL
|
||||
gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl);
|
||||
#endif
|
||||
|
||||
if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) {
|
||||
@@ -436,10 +509,27 @@ PHP_MSHUTDOWN_FUNCTION(curl)
|
||||
php_unregister_url_stream_wrapper("https" TSRMLS_CC);
|
||||
php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
|
||||
php_unregister_url_stream_wrapper("ldap" TSRMLS_CC);
|
||||
#endif
|
||||
#ifdef PHP_CURL_NEED_OPENSSL_TSL
|
||||
/* ensure there are valid callbacks set */
|
||||
CRYPTO_set_id_callback(php_curl_ssl_id);
|
||||
CRYPTO_set_locking_callback(php_curl_ssl_lock);
|
||||
#endif
|
||||
curl_global_cleanup();
|
||||
#ifdef PHP_CURL_NEED_SSL_TSL
|
||||
php_curl_ssl_cleanup();
|
||||
#ifdef PHP_CURL_NEED_OPENSSL_TSL
|
||||
if (php_curl_openssl_tsl) {
|
||||
int i, c = CRYPTO_num_locks();
|
||||
|
||||
CRYPTO_set_id_callback(NULL);
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
|
||||
for (i = 0; i < c; ++i) {
|
||||
tsrm_mutex_free(php_curl_openssl_tsl[i]);
|
||||
}
|
||||
|
||||
free(php_curl_openssl_tsl);
|
||||
php_curl_openssl_tsl = NULL;
|
||||
}
|
||||
#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -470,7 +560,9 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
case PHP_CURL_FILE:
|
||||
return fwrite(data, size, nmemb, t->fp);
|
||||
case PHP_CURL_RETURN:
|
||||
smart_str_appendl(&t->buf, data, (int) length);
|
||||
if (length > 0) {
|
||||
smart_str_appendl(&t->buf, data, (int) length);
|
||||
}
|
||||
break;
|
||||
case PHP_CURL_USER: {
|
||||
zval *argv[2];
|
||||
@@ -585,10 +677,11 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
||||
case PHP_CURL_STDOUT:
|
||||
/* Handle special case write when we're returning the entire transfer
|
||||
*/
|
||||
if (ch->handlers->write->method == PHP_CURL_RETURN)
|
||||
if (ch->handlers->write->method == PHP_CURL_RETURN && length > 0) {
|
||||
smart_str_appendl(&ch->handlers->write->buf, data, (int) length);
|
||||
else
|
||||
} else {
|
||||
PHPWRITE(data, length);
|
||||
}
|
||||
break;
|
||||
case PHP_CURL_FILE:
|
||||
return fwrite(data, size, nmemb, t->fp);
|
||||
@@ -613,19 +706,17 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
||||
retval, 2, argv TSRMLS_CC);
|
||||
ch->in_callback = 0;
|
||||
if (error == FAILURE) {
|
||||
php_error(E_WARNING, "%s(): Couldn't call the CURLOPT_HEADERFUNCTION",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
|
||||
length = -1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (Z_TYPE_P(retval) != IS_LONG) {
|
||||
convert_to_long_ex(&retval);
|
||||
}
|
||||
length = Z_LVAL_P(retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
zval_ptr_dtor(&argv[0]);
|
||||
zval_ptr_dtor(&argv[1]);
|
||||
zval_ptr_dtor(&retval);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -839,7 +930,6 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_FTPLISTONLY:
|
||||
case CURLOPT_FTPAPPEND:
|
||||
case CURLOPT_NETRC:
|
||||
case CURLOPT_FOLLOWLOCATION:
|
||||
case CURLOPT_PUT:
|
||||
#if CURLOPT_MUTE != 0
|
||||
case CURLOPT_MUTE:
|
||||
@@ -876,6 +966,16 @@ PHP_FUNCTION(curl_setopt)
|
||||
convert_to_long_ex(zvalue);
|
||||
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
|
||||
break;
|
||||
case CURLOPT_FOLLOWLOCATION:
|
||||
convert_to_long_ex(zvalue);
|
||||
if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
|
||||
if (Z_LVAL_PP(zvalue) != 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
|
||||
break;
|
||||
case CURLOPT_URL:
|
||||
case CURLOPT_PROXY:
|
||||
case CURLOPT_USERPWD:
|
||||
@@ -977,6 +1077,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_WRITEFUNCTION:
|
||||
if (ch->handlers->write->func) {
|
||||
zval_ptr_dtor(&ch->handlers->write->func);
|
||||
ch->handlers->write->func = NULL;
|
||||
}
|
||||
zval_add_ref(zvalue);
|
||||
ch->handlers->write->func = *zvalue;
|
||||
@@ -985,6 +1086,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_READFUNCTION:
|
||||
if (ch->handlers->read->func) {
|
||||
zval_ptr_dtor(&ch->handlers->read->func);
|
||||
ch->handlers->read->func = NULL;
|
||||
}
|
||||
zval_add_ref(zvalue);
|
||||
ch->handlers->read->func = *zvalue;
|
||||
@@ -993,6 +1095,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_HEADERFUNCTION:
|
||||
if (ch->handlers->write_header->func) {
|
||||
zval_ptr_dtor(&ch->handlers->write_header->func);
|
||||
ch->handlers->write_header->func = NULL;
|
||||
}
|
||||
zval_add_ref(zvalue);
|
||||
ch->handlers->write_header->func = *zvalue;
|
||||
@@ -1002,6 +1105,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_PASSWDFUNCTION:
|
||||
if (ch->handlers->passwd) {
|
||||
zval_ptr_dtor(&ch->handlers->passwd);
|
||||
ch->handlers->passwd = NULL;
|
||||
}
|
||||
zval_add_ref(zvalue);
|
||||
ch->handlers->passwd = *zvalue;
|
||||
@@ -1159,12 +1263,9 @@ PHP_FUNCTION(curl_setopt)
|
||||
static void
|
||||
cleanup_handle(php_curl *ch)
|
||||
{
|
||||
if (ch->uses < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ch->handlers->write->buf.len) {
|
||||
memset(&ch->handlers->write->buf, 0, sizeof(smart_str));
|
||||
if (ch->handlers->write->buf.len > 0) {
|
||||
smart_str_free(&ch->handlers->write->buf);
|
||||
ch->handlers->write->buf.len = 0;
|
||||
}
|
||||
|
||||
memset(ch->err.str, 0, CURL_ERROR_SIZE + 1);
|
||||
@@ -1194,6 +1295,7 @@ PHP_FUNCTION(curl_exec)
|
||||
if (error != CURLE_OK && error != CURLE_PARTIAL_FILE) {
|
||||
if (ch->handlers->write->buf.len > 0) {
|
||||
smart_str_free(&ch->handlers->write->buf);
|
||||
ch->handlers->write->buf.len = 0;
|
||||
}
|
||||
|
||||
RETURN_FALSE;
|
||||
@@ -1202,9 +1304,15 @@ PHP_FUNCTION(curl_exec)
|
||||
ch->uses++;
|
||||
|
||||
if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
|
||||
if (ch->handlers->write->type != PHP_CURL_BINARY)
|
||||
--ch->uses;
|
||||
if (ch->handlers->write->type != PHP_CURL_BINARY) {
|
||||
smart_str_0(&ch->handlers->write->buf);
|
||||
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0);
|
||||
}
|
||||
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
|
||||
}
|
||||
--ch->uses;
|
||||
if (ch->handlers->write->method == PHP_CURL_RETURN) {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
|
||||
RETURN_TRUE;
|
||||
@@ -1406,7 +1514,11 @@ PHP_FUNCTION(curl_close)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to close CURL handle from a callback");
|
||||
return;
|
||||
}
|
||||
zend_list_delete(Z_LVAL_PP(zid));
|
||||
if (ch->uses) {
|
||||
ch->uses--;
|
||||
} else {
|
||||
zend_list_delete(Z_LVAL_PP(zid));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1421,14 +1533,26 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
zend_llist_clean(&ch->to_free.slist);
|
||||
zend_llist_clean(&ch->to_free.post);
|
||||
|
||||
if (ch->handlers->write->func)
|
||||
zval_ptr_dtor(&ch->handlers->write->func);
|
||||
if (ch->handlers->read->func)
|
||||
if (ch->handlers->write->buf.len > 0) {
|
||||
smart_str_free(&ch->handlers->write->buf);
|
||||
ch->handlers->write->buf.len = 0;
|
||||
}
|
||||
if (ch->handlers->write->func) {
|
||||
FREE_ZVAL(ch->handlers->write->func);
|
||||
ch->handlers->read->func = NULL;
|
||||
}
|
||||
if (ch->handlers->read->func) {
|
||||
zval_ptr_dtor(&ch->handlers->read->func);
|
||||
if (ch->handlers->write_header->func)
|
||||
zval_ptr_dtor(&ch->handlers->write_header->func);
|
||||
if (ch->handlers->passwd)
|
||||
zval_ptr_dtor(&ch->handlers->passwd);
|
||||
ch->handlers->read->func = NULL;
|
||||
}
|
||||
if (ch->handlers->write_header->func) {
|
||||
FREE_ZVAL(ch->handlers->write_header->func);
|
||||
ch->handlers->write_header->func = NULL;
|
||||
}
|
||||
if (ch->handlers->passwd) {
|
||||
FREE_ZVAL(ch->handlers->passwd);
|
||||
ch->handlers->passwd = NULL;
|
||||
}
|
||||
|
||||
efree(ch->handlers->write);
|
||||
efree(ch->handlers->write_header);
|
||||
@@ -1438,105 +1562,6 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef PHP_CURL_NEED_OPENSSL_TSL
|
||||
/* {{{ */
|
||||
static MUTEX_T *php_curl_openssl_tsl = NULL;
|
||||
|
||||
static void php_curl_ssl_lock(int mode, int n, const char * file, int line)
|
||||
{
|
||||
if (mode & CRYPTO_LOCK) {
|
||||
tsrm_mutex_lock(php_curl_openssl_tsl[n]);
|
||||
} else {
|
||||
tsrm_mutex_unlock(php_curl_openssl_tsl[n]);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned long php_curl_ssl_id(void)
|
||||
{
|
||||
return (unsigned long) tsrm_thread_id();
|
||||
}
|
||||
|
||||
static inline void php_curl_ssl_init(void)
|
||||
{
|
||||
int i, c = CRYPTO_num_locks();
|
||||
|
||||
php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
|
||||
|
||||
for (i = 0; i < c; ++i) {
|
||||
php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
|
||||
}
|
||||
|
||||
CRYPTO_set_id_callback(php_curl_ssl_id);
|
||||
CRYPTO_set_locking_callback(php_curl_ssl_lock);
|
||||
}
|
||||
|
||||
static inline void php_curl_ssl_cleanup(void)
|
||||
{
|
||||
if (php_curl_openssl_tsl) {
|
||||
int i, c = CRYPTO_num_locks();
|
||||
|
||||
CRYPTO_set_id_callback(NULL);
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
|
||||
for (i = 0; i < c; ++i) {
|
||||
tsrm_mutex_free(php_curl_openssl_tsl[i]);
|
||||
}
|
||||
|
||||
free(php_curl_openssl_tsl);
|
||||
php_curl_openssl_tsl = NULL;
|
||||
}
|
||||
}
|
||||
#endif /* PHP_CURL_NEED_OPENSSL_TSL */
|
||||
/* }}} */
|
||||
|
||||
#ifdef PHP_CURL_NEED_GNUTLS_TSL
|
||||
/* {{{ */
|
||||
static int php_curl_ssl_mutex_create(void **m)
|
||||
{
|
||||
if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) {
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
static int php_curl_ssl_mutex_destroy(void **m)
|
||||
{
|
||||
tsrm_mutex_free(*((MUTEX_T *) m));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static int php_curl_ssl_mutex_lock(void **m)
|
||||
{
|
||||
return tsrm_mutex_lock(*((MUTEX_T *) m));
|
||||
}
|
||||
|
||||
static int php_curl_ssl_mutex_unlock(void **m)
|
||||
{
|
||||
return tsrm_mutex_unlock(*((MUTEX_T *) m));
|
||||
}
|
||||
|
||||
static struct gcry_thread_cbs php_curl_gnutls_tsl = {
|
||||
GCRY_THREAD_OPTIONS_USER,
|
||||
NULL,
|
||||
php_curl_ssl_mutex_create,
|
||||
php_curl_ssl_mutex_destroy,
|
||||
php_curl_ssl_mutex_lock,
|
||||
php_curl_ssl_mutex_unlock
|
||||
};
|
||||
|
||||
static inline void php_curl_ssl_init(void)
|
||||
{
|
||||
gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl);
|
||||
}
|
||||
|
||||
static inline void php_curl_ssl_cleanup(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif /* PHP_CURL_NEED_GNUTLS_TSL */
|
||||
/* }}} */
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
/*
|
||||
|
||||
+4
-4
@@ -46,7 +46,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "CURL_STATICLIB" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -74,7 +74,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /D "CURL_STATICLIB" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -102,7 +102,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /D "CURL_STATICLIB" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -131,7 +131,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "CURL_STATICLIB" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -297,7 +297,11 @@ PHPAPI php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *fil
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_WRITEHEADER, stream);
|
||||
|
||||
/* currently buggy (bug is in curl) */
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0);
|
||||
} else {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
}
|
||||
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_ERRORBUFFER, curlstream->errstr);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_VERBOSE, 0);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ AC_ARG_WITH(db4,
|
||||
break
|
||||
fi
|
||||
done
|
||||
PHP_DBA_DB_CHECK(4, db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
PHP_DBA_DB_CHECK(4, db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
fi
|
||||
])
|
||||
AC_DBA_STD_RESULT(db4,Berkeley DB4)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -23,4 +23,4 @@ unlink('/tmp/bug31754.dbf');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: dbase_open(): Cannot open /tmp/bug31754.dbf in write-only mode in %sbug31754.php on line %d
|
||||
Warning: dbase_open() [/phpmanual/function.dbase-open.html]: Cannot open /tmp/bug31754.dbf in write-only mode in %sbug31754.php on line %d
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -44,7 +44,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOMXML" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOMXML=1 /D HAVE_DOMXSLT=1 /D LIBXML_STATIC=1 /D LIBXSLT_STATIC=1 /D "LIBXML_THREAD_ENABLED" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOMXML=1 /D HAVE_DOMXSLT=1 /D LIBXML_STATIC=1 /D LIBXSLT_STATIC=1 /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC_FOR_DLL" /D HAVE_DOMEXSLT=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 wsock32.lib php4ts.lib libxml2_a.lib libxslt_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_domxml.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
|
||||
# ADD LINK32 wsock32.lib php4ts.lib libxml2_a_dll.lib libxslt_a.lib libexslt_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_domxml.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "domxml - Win32 Debug_TS"
|
||||
@@ -72,7 +72,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOMXML" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOMXML=1 /D HAVE_DOMXSLT=1 /D LIBXML_STATIC=1 /D LIBXSLT_STATIC=1 /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOMXML=1 /D HAVE_DOMXSLT=1 /D LIBXML_STATIC=1 /D LIBXSLT_STATIC=1 /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC_FOR_DLL" /D HAVE_DOMEXSLT=1 /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -82,7 +82,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts_debug.lib libxml2_a.lib libxslt_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_domxml.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
|
||||
# ADD LINK32 php4ts_debug.lib libxml2_a_dll.lib libxslt_a.lib libexslt_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_domxml.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
+10
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -649,6 +649,7 @@ static inline void node_list_wrapper_dtor(xmlNodePtr node, int destroyref TSRMLS
|
||||
/* Skip property freeing for the following types */
|
||||
case XML_ATTRIBUTE_DECL:
|
||||
case XML_DTD_NODE:
|
||||
case XML_ELEMENT_DECL:
|
||||
case XML_ENTITY_DECL:
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
break;
|
||||
@@ -689,6 +690,7 @@ static inline void node_list_unlink(xmlNodePtr node)
|
||||
case XML_ATTRIBUTE_DECL:
|
||||
case XML_DTD_NODE:
|
||||
case XML_ENTITY_DECL:
|
||||
case XML_ELEMENT_DECL:
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
break;
|
||||
default:
|
||||
@@ -5518,6 +5520,13 @@ PHP_FUNCTION(domxml_xslt_version)
|
||||
/* }}} */
|
||||
#endif /* HAVE_DOMXSLT */
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
return xmlDllMain(hinstDLL, fdwReason, lpvReserved);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_DOMXML */
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
| Copyright (c) 1997-2008 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
-668
@@ -1,668 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Rasmus Lerdorf <rasmus@php.net> |
|
||||
| Jim Winstead <jimw@php.net> |
|
||||
| Jaakko Hyvätti <jaakko@hyvatti.iki.fi> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include "php.h"
|
||||
#include "php_string.h"
|
||||
#include "reg.h"
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(reg)
|
||||
|
||||
typedef struct {
|
||||
regex_t preg;
|
||||
int cflags;
|
||||
} reg_cache;
|
||||
|
||||
static int reg_magic = 0;
|
||||
|
||||
/* {{{ _php_regcomp
|
||||
*/
|
||||
static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
|
||||
{
|
||||
int r = 0;
|
||||
int patlen = strlen(pattern);
|
||||
reg_cache *rc = NULL;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == SUCCESS
|
||||
&& rc->cflags == cflags) {
|
||||
#ifdef HAVE_REGEX_T_RE_MAGIC
|
||||
/*
|
||||
* We use a saved magic number to see whether cache is corrupted, and if it
|
||||
* is, we flush it and compile the pattern from scratch.
|
||||
*/
|
||||
if (rc->preg.re_magic != reg_magic) {
|
||||
zend_hash_clean(®(ht_rc));
|
||||
} else {
|
||||
memcpy(preg, &rc->preg, sizeof(*preg));
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
r = regcomp(preg, pattern, cflags);
|
||||
if(!r) {
|
||||
reg_cache rcp;
|
||||
|
||||
rcp.cflags = cflags;
|
||||
memcpy(&rcp.preg, preg, sizeof(*preg));
|
||||
/*
|
||||
* Since we don't have access to the actual MAGIC1 definition in the private
|
||||
* header file, we save the magic value immediately after compilation. Hopefully,
|
||||
* it's good.
|
||||
*/
|
||||
if (!reg_magic) reg_magic = preg->re_magic;
|
||||
zend_hash_update(®(ht_rc), (char *) pattern, patlen+1,
|
||||
(void *) &rcp, sizeof(rcp), NULL);
|
||||
}
|
||||
#else
|
||||
memcpy(preg, &rc->preg, sizeof(*preg));
|
||||
} else {
|
||||
r = regcomp(preg, pattern, cflags);
|
||||
if(!r) {
|
||||
reg_cache rcp;
|
||||
|
||||
rcp.cflags = cflags;
|
||||
memcpy(&rcp.preg, preg, sizeof(*preg));
|
||||
zend_hash_update(®(ht_rc), (char *) pattern, patlen+1,
|
||||
(void *) &rcp, sizeof(rcp), NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void _free_reg_cache(reg_cache *rc)
|
||||
{
|
||||
regfree(&rc->preg);
|
||||
}
|
||||
|
||||
#undef regfree
|
||||
#define regfree(a);
|
||||
#undef regcomp
|
||||
#define regcomp(a, b, c) _php_regcomp(a, b, c)
|
||||
|
||||
static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC)
|
||||
{
|
||||
zend_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
|
||||
}
|
||||
|
||||
static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC)
|
||||
{
|
||||
zend_hash_destroy(®_globals->ht_rc);
|
||||
}
|
||||
|
||||
PHP_MINIT_FUNCTION(regex)
|
||||
{
|
||||
ZEND_INIT_MODULE_GLOBALS(reg, php_reg_init_globals, php_reg_destroy_globals);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MSHUTDOWN_FUNCTION(regex)
|
||||
{
|
||||
#ifndef ZTS
|
||||
php_reg_destroy_globals(®_globals TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MINFO_FUNCTION(regex)
|
||||
{
|
||||
#if HSREGEX
|
||||
php_info_print_table_row(2, "Regex Library", "Bundled library enabled");
|
||||
#else
|
||||
php_info_print_table_row(2, "Regex Library", "System library enabled");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* {{{ php_reg_eprint
|
||||
* php_reg_eprint - convert error number to name
|
||||
*/
|
||||
static void php_reg_eprint(int err, regex_t *re) {
|
||||
char *buf = NULL, *message = NULL;
|
||||
size_t len;
|
||||
size_t buf_len;
|
||||
|
||||
#ifdef REG_ITOA
|
||||
/* get the length of the message */
|
||||
buf_len = regerror(REG_ITOA | err, re, NULL, 0);
|
||||
if (buf_len) {
|
||||
buf = (char *)safe_emalloc(buf_len, sizeof(char), 0);
|
||||
if (!buf) return; /* fail silently */
|
||||
/* finally, get the error message */
|
||||
regerror(REG_ITOA | err, re, buf, buf_len);
|
||||
}
|
||||
#else
|
||||
buf_len = 0;
|
||||
#endif
|
||||
len = regerror(err, re, NULL, 0);
|
||||
if (len) {
|
||||
TSRMLS_FETCH();
|
||||
|
||||
message = (char *)safe_emalloc((buf_len + len + 2), sizeof(char), 0);
|
||||
if (!message) {
|
||||
return; /* fail silently */
|
||||
}
|
||||
if (buf_len) {
|
||||
snprintf(message, buf_len, "%s: ", buf);
|
||||
buf_len += 1; /* so pointer math below works */
|
||||
}
|
||||
/* drop the message into place */
|
||||
regerror(err, re, message + buf_len, len);
|
||||
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
|
||||
}
|
||||
|
||||
STR_FREE(buf);
|
||||
STR_FREE(message);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_ereg
|
||||
*/
|
||||
static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
{
|
||||
pval **regex, /* Regular expression */
|
||||
**findin, /* String to apply expression to */
|
||||
**array = NULL; /* Optional register array */
|
||||
regex_t re;
|
||||
regmatch_t *subs;
|
||||
int err, match_len, string_len;
|
||||
uint i;
|
||||
int copts = 0;
|
||||
off_t start, end;
|
||||
char *buf = NULL;
|
||||
char *string = NULL;
|
||||
int argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (argc < 2 || argc > 3 ||
|
||||
zend_get_parameters_ex(argc, ®ex, &findin, &array) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (icase)
|
||||
copts |= REG_ICASE;
|
||||
|
||||
if (argc == 2)
|
||||
copts |= REG_NOSUB;
|
||||
|
||||
/* compile the regular expression from the supplied regex */
|
||||
if (Z_TYPE_PP(regex) == IS_STRING) {
|
||||
err = regcomp(&re, Z_STRVAL_PP(regex), REG_EXTENDED | copts);
|
||||
} else {
|
||||
/* we convert numbers to integers and treat them as a string */
|
||||
if (Z_TYPE_PP(regex) == IS_DOUBLE)
|
||||
convert_to_long_ex(regex); /* get rid of decimal places */
|
||||
convert_to_string_ex(regex);
|
||||
/* don't bother doing an extended regex with just a number */
|
||||
err = regcomp(&re, Z_STRVAL_PP(regex), copts);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
php_reg_eprint(err, &re);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* make a copy of the string we're looking in */
|
||||
convert_to_string_ex(findin);
|
||||
string = estrndup(Z_STRVAL_PP(findin), Z_STRLEN_PP(findin));
|
||||
|
||||
/* allocate storage for (sub-)expression-matches */
|
||||
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1);
|
||||
|
||||
/* actually execute the regular expression */
|
||||
err = regexec(&re, string, re.re_nsub+1, subs, 0);
|
||||
if (err && err != REG_NOMATCH) {
|
||||
php_reg_eprint(err, &re);
|
||||
regfree(&re);
|
||||
efree(subs);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
match_len = 1;
|
||||
|
||||
if (array && err != REG_NOMATCH) {
|
||||
match_len = (int) (subs[0].rm_eo - subs[0].rm_so);
|
||||
string_len = Z_STRLEN_PP(findin) + 1;
|
||||
|
||||
buf = emalloc(string_len);
|
||||
|
||||
zval_dtor(*array); /* start with clean array */
|
||||
array_init(*array);
|
||||
|
||||
for (i = 0; i <= re.re_nsub; i++) {
|
||||
start = subs[i].rm_so;
|
||||
end = subs[i].rm_eo;
|
||||
if (start != -1 && end > 0 && start < string_len && end < string_len && start < end) {
|
||||
add_index_stringl(*array, i, string+start, end-start, 1);
|
||||
} else {
|
||||
add_index_bool(*array, i, 0);
|
||||
}
|
||||
}
|
||||
efree(buf);
|
||||
}
|
||||
|
||||
efree(subs);
|
||||
efree(string);
|
||||
if (err == REG_NOMATCH) {
|
||||
RETVAL_FALSE;
|
||||
} else {
|
||||
if (match_len == 0)
|
||||
match_len = 1;
|
||||
RETVAL_LONG(match_len);
|
||||
}
|
||||
regfree(&re);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int ereg(string pattern, string string [, array registers])
|
||||
Regular expression match */
|
||||
PHP_FUNCTION(ereg)
|
||||
{
|
||||
php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int eregi(string pattern, string string [, array registers])
|
||||
Case-insensitive regular expression match */
|
||||
PHP_FUNCTION(eregi)
|
||||
{
|
||||
php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_reg_replace
|
||||
* this is the meat and potatoes of regex replacement! */
|
||||
PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended)
|
||||
{
|
||||
regex_t re;
|
||||
regmatch_t *subs;
|
||||
|
||||
char *buf, /* buf is where we build the replaced string */
|
||||
*nbuf, /* nbuf is used when we grow the buffer */
|
||||
*walkbuf; /* used to walk buf when replacing backrefs */
|
||||
const char *walk; /* used to walk replacement string for backrefs */
|
||||
int buf_len;
|
||||
int pos, tmp, string_len, new_l;
|
||||
int err, copts = 0;
|
||||
|
||||
string_len = strlen(string);
|
||||
|
||||
if (icase) {
|
||||
copts = REG_ICASE;
|
||||
}
|
||||
if (extended) {
|
||||
copts |= REG_EXTENDED;
|
||||
}
|
||||
|
||||
err = regcomp(&re, pattern, copts);
|
||||
if (err) {
|
||||
php_reg_eprint(err, &re);
|
||||
return ((char *) -1);
|
||||
}
|
||||
|
||||
|
||||
/* allocate storage for (sub-)expression-matches */
|
||||
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1);
|
||||
|
||||
/* start with a buffer that is twice the size of the stringo
|
||||
we're doing replacements in */
|
||||
buf_len = 2 * string_len + 1;
|
||||
buf = safe_emalloc(buf_len, sizeof(char), 0);
|
||||
|
||||
err = pos = 0;
|
||||
buf[0] = '\0';
|
||||
while (!err) {
|
||||
err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0));
|
||||
|
||||
if (err && err != REG_NOMATCH) {
|
||||
php_reg_eprint(err, &re);
|
||||
efree(subs);
|
||||
efree(buf);
|
||||
regfree(&re);
|
||||
return ((char *) -1);
|
||||
}
|
||||
|
||||
if (!err) {
|
||||
/* backref replacement is done in two passes:
|
||||
1) find out how long the string will be, and allocate buf
|
||||
2) copy the part before match, replacement and backrefs to buf
|
||||
|
||||
Jaakko Hyvätti <Jaakko.Hyvatti@iki.fi>
|
||||
*/
|
||||
|
||||
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
|
||||
walk = replace;
|
||||
while (*walk) {
|
||||
if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
|
||||
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) {
|
||||
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
|
||||
}
|
||||
walk += 2;
|
||||
} else {
|
||||
new_l++;
|
||||
walk++;
|
||||
}
|
||||
}
|
||||
if (new_l + 1 > buf_len) {
|
||||
buf_len = 1 + buf_len + 2 * new_l;
|
||||
nbuf = emalloc(buf_len);
|
||||
strcpy(nbuf, buf);
|
||||
efree(buf);
|
||||
buf = nbuf;
|
||||
}
|
||||
tmp = strlen(buf);
|
||||
/* copy the part of the string before the match */
|
||||
strncat(buf, &string[pos], subs[0].rm_so);
|
||||
|
||||
/* copy replacement and backrefs */
|
||||
walkbuf = &buf[tmp + subs[0].rm_so];
|
||||
walk = replace;
|
||||
while (*walk) {
|
||||
if ('\\' == *walk && isdigit(walk[1]) && walk[1] - '0' <= re.re_nsub) {
|
||||
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1
|
||||
/* this next case shouldn't happen. it does. */
|
||||
&& subs[walk[1] - '0'].rm_so <= subs[walk[1] - '0'].rm_eo) {
|
||||
|
||||
tmp = subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
|
||||
memcpy (walkbuf, &string[pos + subs[walk[1] - '0'].rm_so], tmp);
|
||||
walkbuf += tmp;
|
||||
}
|
||||
walk += 2;
|
||||
} else {
|
||||
*walkbuf++ = *walk++;
|
||||
}
|
||||
}
|
||||
*walkbuf = '\0';
|
||||
|
||||
/* and get ready to keep looking for replacements */
|
||||
if (subs[0].rm_so == subs[0].rm_eo) {
|
||||
if (subs[0].rm_so + pos >= string_len) {
|
||||
break;
|
||||
}
|
||||
new_l = strlen (buf) + 1;
|
||||
if (new_l + 1 > buf_len) {
|
||||
buf_len = 1 + buf_len + 2 * new_l;
|
||||
nbuf = safe_emalloc(buf_len, sizeof(char), 0);
|
||||
strcpy(nbuf, buf);
|
||||
efree(buf);
|
||||
buf = nbuf;
|
||||
}
|
||||
pos += subs[0].rm_eo + 1;
|
||||
buf [new_l-1] = string [pos-1];
|
||||
buf [new_l] = '\0';
|
||||
} else {
|
||||
pos += subs[0].rm_eo;
|
||||
}
|
||||
} else { /* REG_NOMATCH */
|
||||
new_l = strlen(buf) + strlen(&string[pos]);
|
||||
if (new_l + 1 > buf_len) {
|
||||
buf_len = new_l + 1; /* now we know exactly how long it is */
|
||||
nbuf = safe_emalloc(buf_len, sizeof(char), 0);
|
||||
strcpy(nbuf, buf);
|
||||
efree(buf);
|
||||
buf = nbuf;
|
||||
}
|
||||
/* stick that last bit of string on our output */
|
||||
strcat(buf, &string[pos]);
|
||||
}
|
||||
}
|
||||
|
||||
/* don't want to leak memory .. */
|
||||
efree(subs);
|
||||
regfree(&re);
|
||||
|
||||
/* whew. */
|
||||
return (buf);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_ereg_replace
|
||||
*/
|
||||
static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
{
|
||||
pval **arg_pattern,
|
||||
**arg_replace,
|
||||
**arg_string;
|
||||
char *pattern;
|
||||
char *string;
|
||||
char *replace;
|
||||
char *ret;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 ||
|
||||
zend_get_parameters_ex(3, &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(arg_pattern) == IS_STRING) {
|
||||
if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern))
|
||||
pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern));
|
||||
else
|
||||
pattern = empty_string;
|
||||
} else {
|
||||
convert_to_long_ex(arg_pattern);
|
||||
pattern = emalloc(2);
|
||||
pattern[0] = (char) Z_LVAL_PP(arg_pattern);
|
||||
pattern[1] = '\0';
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(arg_replace) == IS_STRING) {
|
||||
if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace))
|
||||
replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace));
|
||||
else
|
||||
replace = empty_string;
|
||||
} else {
|
||||
convert_to_long_ex(arg_replace);
|
||||
replace = emalloc(2);
|
||||
replace[0] = (char) Z_LVAL_PP(arg_replace);
|
||||
replace[1] = '\0';
|
||||
}
|
||||
|
||||
convert_to_string_ex(arg_string);
|
||||
if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string))
|
||||
string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string));
|
||||
else
|
||||
string = empty_string;
|
||||
|
||||
/* do the actual work */
|
||||
ret = php_reg_replace(pattern, replace, string, icase, 1);
|
||||
if (ret == (char *) -1) {
|
||||
RETVAL_FALSE;
|
||||
} else {
|
||||
RETVAL_STRING(ret, 1);
|
||||
STR_FREE(ret);
|
||||
}
|
||||
|
||||
STR_FREE(string);
|
||||
STR_FREE(replace);
|
||||
STR_FREE(pattern);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string ereg_replace(string pattern, string replacement, string string)
|
||||
Replace regular expression */
|
||||
PHP_FUNCTION(ereg_replace)
|
||||
{
|
||||
php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string eregi_replace(string pattern, string replacement, string string)
|
||||
Case insensitive replace regular expression */
|
||||
PHP_FUNCTION(eregi_replace)
|
||||
{
|
||||
php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_split
|
||||
*/
|
||||
static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
{
|
||||
zval **spliton, **str, **arg_count = NULL;
|
||||
regex_t re;
|
||||
regmatch_t subs[1];
|
||||
char *strp, *endp;
|
||||
int err, size, count = -1, copts = 0;
|
||||
int argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (argc < 2 || argc > 3 ||
|
||||
zend_get_parameters_ex(argc, &spliton, &str, &arg_count) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
convert_to_long_ex(arg_count);
|
||||
count = Z_LVAL_PP(arg_count);
|
||||
}
|
||||
|
||||
if (icase)
|
||||
copts = REG_ICASE;
|
||||
|
||||
convert_to_string_ex(spliton);
|
||||
convert_to_string_ex(str);
|
||||
|
||||
strp = Z_STRVAL_PP(str);
|
||||
endp = strp + Z_STRLEN_PP(str);
|
||||
|
||||
err = regcomp(&re, Z_STRVAL_PP(spliton), REG_EXTENDED | copts);
|
||||
if (err) {
|
||||
php_reg_eprint(err, &re);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
/* churn through str, generating array entries as we go */
|
||||
while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) {
|
||||
if (subs[0].rm_so == 0 && subs[0].rm_eo) {
|
||||
/* match is at start of string, return empty string */
|
||||
add_next_index_stringl(return_value, empty_string, 0, 1);
|
||||
/* skip ahead the length of the regex match */
|
||||
strp += subs[0].rm_eo;
|
||||
} else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) {
|
||||
/* No more matches */
|
||||
regfree(&re);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression to split()");
|
||||
zend_hash_destroy(Z_ARRVAL_P(return_value));
|
||||
efree(Z_ARRVAL_P(return_value));
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
/* On a real match */
|
||||
|
||||
/* make a copy of the substring */
|
||||
size = subs[0].rm_so;
|
||||
|
||||
/* add it to the array */
|
||||
add_next_index_stringl(return_value, strp, size, 1);
|
||||
|
||||
/* point at our new starting point */
|
||||
strp = strp + subs[0].rm_eo;
|
||||
}
|
||||
|
||||
/* if we're only looking for a certain number of points,
|
||||
stop looking once we hit it */
|
||||
if (count != -1) {
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
/* see if we encountered an error */
|
||||
if (err && err != REG_NOMATCH) {
|
||||
php_reg_eprint(err, &re);
|
||||
regfree(&re);
|
||||
zend_hash_destroy(Z_ARRVAL_P(return_value));
|
||||
efree(Z_ARRVAL_P(return_value));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* otherwise we just have one last element to add to the array */
|
||||
size = endp - strp;
|
||||
|
||||
add_next_index_stringl(return_value, strp, size, 1);
|
||||
|
||||
regfree(&re);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array split(string pattern, string string [, int limit])
|
||||
Split string into array by regular expression */
|
||||
PHP_FUNCTION(split)
|
||||
{
|
||||
php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array spliti(string pattern, string string [, int limit])
|
||||
Split string into array by regular expression case-insensitive */
|
||||
|
||||
PHP_FUNCTION(spliti)
|
||||
{
|
||||
php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string sql_regcase(string string)
|
||||
Make regular expression for case insensitive match */
|
||||
PHPAPI PHP_FUNCTION(sql_regcase)
|
||||
{
|
||||
zval **string;
|
||||
char *tmp;
|
||||
unsigned char c;
|
||||
register int i, j;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &string)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(string);
|
||||
|
||||
tmp = safe_emalloc(Z_STRLEN_PP(string), 4, 1);
|
||||
|
||||
for (i = j = 0; i < Z_STRLEN_PP(string); i++) {
|
||||
c = (unsigned char) Z_STRVAL_PP(string)[i];
|
||||
if(isalpha(c)) {
|
||||
tmp[j++] = '[';
|
||||
tmp[j++] = toupper(c);
|
||||
tmp[j++] = tolower(c);
|
||||
tmp[j++] = ']';
|
||||
} else {
|
||||
tmp[j++] = c;
|
||||
}
|
||||
}
|
||||
tmp[j] = 0;
|
||||
|
||||
RETVAL_STRINGL(tmp, j, 1);
|
||||
efree(tmp);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: noet sw=4 ts=4 fdm=marker
|
||||
* vim<600: noet sw=4 ts=4
|
||||
*/
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2006 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef REG_H
|
||||
#define REG_H
|
||||
|
||||
PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended);
|
||||
|
||||
PHP_FUNCTION(ereg);
|
||||
PHP_FUNCTION(eregi);
|
||||
PHP_FUNCTION(eregi_replace);
|
||||
PHP_FUNCTION(ereg_replace);
|
||||
PHP_FUNCTION(split);
|
||||
PHP_FUNCTION(spliti);
|
||||
PHPAPI PHP_FUNCTION(sql_regcase);
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(reg)
|
||||
HashTable ht_rc;
|
||||
ZEND_END_MODULE_GLOBALS(reg)
|
||||
|
||||
PHP_MINIT_FUNCTION(regex);
|
||||
PHP_MSHUTDOWN_FUNCTION(regex);
|
||||
PHP_MINFO_FUNCTION(regex);
|
||||
|
||||
|
||||
#ifdef ZTS
|
||||
#define REG(v) TSRMG(reg_globals_id, zend_reg_globals *, v)
|
||||
#else
|
||||
#define REG(v) (reg_globals.v)
|
||||
#endif
|
||||
|
||||
#endif /* REG_H */
|
||||
@@ -1,45 +0,0 @@
|
||||
#ifndef PHP_REGEX_H
|
||||
#define PHP_REGEX_H
|
||||
|
||||
/*
|
||||
* REGEX means:
|
||||
* 0.. system regex
|
||||
* 1.. bundled regex
|
||||
*/
|
||||
|
||||
#if REGEX
|
||||
/* get aliases */
|
||||
#include "regex/regex_extra.h"
|
||||
#include "regex/regex.h"
|
||||
|
||||
/* get rid of aliases */
|
||||
#define PHP_NO_ALIASES
|
||||
#include "regex/regex_extra.h"
|
||||
#undef PHP_NO_ALIASES
|
||||
|
||||
#undef _PCREPOSIX_H
|
||||
#define _PCREPOSIX_H 1
|
||||
|
||||
#ifndef _REGEX_H
|
||||
#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */
|
||||
#endif
|
||||
#ifndef _REGEX_H_
|
||||
#define _REGEX_H_ 1
|
||||
#endif
|
||||
#ifndef _RX_H
|
||||
#define _RX_H 1 /* Try defining these for Linux to */
|
||||
#endif
|
||||
#ifndef __REGEXP_LIBRARY_H__
|
||||
#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */
|
||||
#endif
|
||||
#ifndef _H_REGEX
|
||||
#define _H_REGEX 1 /* This one is for AIX */
|
||||
#endif
|
||||
#elif REGEX == 0
|
||||
#include <regex.h>
|
||||
#ifndef _REGEX_H_
|
||||
#define _REGEX_H_ 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* PHP_REGEX_H */
|
||||
@@ -1,20 +0,0 @@
|
||||
Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved.
|
||||
This software is not subject to any license of the American Telephone
|
||||
and Telegraph Company or of the Regents of the University of California.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose on
|
||||
any computer system, and to alter it and redistribute it, subject
|
||||
to the following restrictions:
|
||||
|
||||
1. The author is not responsible for the consequences of use of this
|
||||
software, no matter how awful, even if they arise from flaws in it.
|
||||
|
||||
2. The origin of this software must not be misrepresented, either by
|
||||
explicit claim or by omission. Since few users ever read sources,
|
||||
credits must appear in the documentation.
|
||||
|
||||
3. Altered versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software. Since few users
|
||||
ever read sources, credits must appear in the documentation.
|
||||
|
||||
4. This notice may not be removed or altered.
|
||||
@@ -1,32 +0,0 @@
|
||||
alpha3.4 release.
|
||||
Thu Mar 17 23:17:18 EST 1994
|
||||
henry@zoo.toronto.edu
|
||||
|
||||
See WHATSNEW for change listing.
|
||||
|
||||
installation notes:
|
||||
--------
|
||||
Read the comments at the beginning of Makefile before running.
|
||||
|
||||
Utils.h contains some things that just might have to be modified on
|
||||
some systems, as well as a nested include (ugh) of <assert.h>.
|
||||
|
||||
The "fake" directory contains quick-and-dirty fakes for some header
|
||||
files and routines that old systems may not have. Note also that
|
||||
-DUSEBCOPY will make utils.h substitute bcopy() for memmove().
|
||||
|
||||
After that, "make r" will build regcomp.o, regexec.o, regfree.o,
|
||||
and regerror.o (the actual routines), bundle them together into a test
|
||||
program, and run regression tests on them. No output is good output.
|
||||
|
||||
"make lib" builds just the .o files for the actual routines (when
|
||||
you're happy with testing and have adjusted CFLAGS for production),
|
||||
and puts them together into libregex.a. You can pick up either the
|
||||
library or *.o ("make lib" makes sure there are no other .o files left
|
||||
around to confuse things).
|
||||
|
||||
Main.c, debug.c, split.c are used for regression testing but are not part
|
||||
of the RE routines themselves.
|
||||
|
||||
Regex.h goes in /usr/include. All other .h files are internal only.
|
||||
--------
|
||||
@@ -1,92 +0,0 @@
|
||||
New in alpha3.4: The complex bug alluded to below has been fixed (in a
|
||||
slightly kludgey temporary way that may hurt efficiency a bit; this is
|
||||
another "get it out the door for 4.4" release). The tests at the end of
|
||||
the tests file have accordingly been uncommented. The primary sign of
|
||||
the bug was that something like a?b matching ab matched b rather than ab.
|
||||
(The bug was essentially specific to this exact situation, else it would
|
||||
have shown up earlier.)
|
||||
|
||||
New in alpha3.3: The definition of word boundaries has been altered
|
||||
slightly, to more closely match the usual programming notion that "_"
|
||||
is an alphabetic. Stuff used for pre-ANSI systems is now in a subdir,
|
||||
and the makefile no longer alludes to it in mysterious ways. The
|
||||
makefile has generally been cleaned up some. Fixes have been made
|
||||
(again!) so that the regression test will run without -DREDEBUG, at
|
||||
the cost of weaker checking. A workaround for a bug in some folks'
|
||||
<assert.h> has been added. And some more things have been added to
|
||||
tests, including a couple right at the end which are commented out
|
||||
because the code currently flunks them (complex bug; fix coming).
|
||||
Plus the usual minor cleanup.
|
||||
|
||||
New in alpha3.2: Assorted bits of cleanup and portability improvement
|
||||
(the development base is now a BSDI system using GCC instead of an ancient
|
||||
Sun system, and the newer compiler exposed some glitches). Fix for a
|
||||
serious bug that affected REs using many [] (including REG_ICASE REs
|
||||
because of the way they are implemented), *sometimes*, depending on
|
||||
memory-allocation patterns. The header-file prototypes no longer name
|
||||
the parameters, avoiding possible name conflicts. The possibility that
|
||||
some clot has defined CHAR_MIN as (say) `-128' instead of `(-128)' is
|
||||
now handled gracefully. "uchar" is no longer used as an internal type
|
||||
name (too many people have the same idea). Still the same old lousy
|
||||
performance, alas.
|
||||
|
||||
New in alpha3.1: Basically nothing, this release is just a bookkeeping
|
||||
convenience. Stay tuned.
|
||||
|
||||
New in alpha3.0: Performance is no better, alas, but some fixes have been
|
||||
made and some functionality has been added. (This is basically the "get
|
||||
it out the door in time for 4.4" release.) One bug fix: regfree() didn't
|
||||
free the main internal structure (how embarrassing). It is now possible
|
||||
to put NULs in either the RE or the target string, using (resp.) a new
|
||||
REG_PEND flag and the old REG_STARTEND flag. The REG_NOSPEC flag to
|
||||
regcomp() makes all characters ordinary, so you can match a literal
|
||||
string easily (this will become more useful when performance improves!).
|
||||
There are now primitives to match beginnings and ends of words, although
|
||||
the syntax is disgusting and so is the implementation. The REG_ATOI
|
||||
debugging interface has changed a bit. And there has been considerable
|
||||
internal cleanup of various kinds.
|
||||
|
||||
New in alpha2.3: Split change list out of README, and moved flags notes
|
||||
into Makefile. Macro-ized the name of regex(7) in regex(3), since it has
|
||||
to change for 4.4BSD. Cleanup work in engine.c, and some new regression
|
||||
tests to catch tricky cases thereof.
|
||||
|
||||
New in alpha2.2: Out-of-date manpages updated. Regerror() acquires two
|
||||
small extensions -- REG_ITOA and REG_ATOI -- which avoid debugging kludges
|
||||
in my own test program and might be useful to others for similar purposes.
|
||||
The regression test will now compile (and run) without REDEBUG. The
|
||||
BRE \$ bug is fixed. Most uses of "uchar" are gone; it's all chars now.
|
||||
Char/uchar parameters are now written int/unsigned, to avoid possible
|
||||
portability problems with unpromoted parameters. Some unsigned casts have
|
||||
been introduced to minimize portability problems with shifting into sign
|
||||
bits.
|
||||
|
||||
New in alpha2.1: Lots of little stuff, cleanup and fixes. The one big
|
||||
thing is that regex.h is now generated, using mkh, rather than being
|
||||
supplied in the distribution; due to circularities in dependencies,
|
||||
you have to build regex.h explicitly by "make h". The two known bugs
|
||||
have been fixed (and the regression test now checks for them), as has a
|
||||
problem with assertions not being suppressed in the absence of REDEBUG.
|
||||
No performance work yet.
|
||||
|
||||
New in alpha2: Backslash-anything is an ordinary character, not an
|
||||
error (except, of course, for the handful of backslashed metacharacters
|
||||
in BREs), which should reduce script breakage. The regression test
|
||||
checks *where* null strings are supposed to match, and has generally
|
||||
been tightened up somewhat. Small bug fixes in parameter passing (not
|
||||
harmful, but technically errors) and some other areas. Debugging
|
||||
invoked by defining REDEBUG rather than not defining NDEBUG.
|
||||
|
||||
New in alpha+3: full prototyping for internal routines, using a little
|
||||
helper program, mkh, which extracts prototypes given in stylized comments.
|
||||
More minor cleanup. Buglet fix: it's CHAR_BIT, not CHAR_BITS. Simple
|
||||
pre-screening of input when a literal string is known to be part of the
|
||||
RE; this does wonders for performance.
|
||||
|
||||
New in alpha+2: minor bits of cleanup. Notably, the number "32" for the
|
||||
word width isn't hardwired into regexec.c any more, the public header
|
||||
file prototypes the functions if __STDC__ is defined, and some small typos
|
||||
in the manpages have been fixed.
|
||||
|
||||
New in alpha+1: improvements to the manual pages, and an important
|
||||
extension, the REG_STARTEND option to regexec().
|
||||
@@ -1,30 +0,0 @@
|
||||
/* character-class table */
|
||||
static struct cclass {
|
||||
unsigned char *name;
|
||||
unsigned char *chars;
|
||||
unsigned char *multis;
|
||||
} cclasses[] = {
|
||||
{"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ""},
|
||||
{"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||
""},
|
||||
{"blank", " \t", ""},
|
||||
{"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\
|
||||
\25\26\27\30\31\32\33\34\35\36\37\177", ""},
|
||||
{"digit", "0123456789", ""},
|
||||
{"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
||||
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
|
||||
""},
|
||||
{"lower", "abcdefghijklmnopqrstuvwxyz",
|
||||
""},
|
||||
{"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
||||
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
|
||||
""},
|
||||
{"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
|
||||
""},
|
||||
{"space", "\t\n\v\f\r ", ""},
|
||||
{"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
""},
|
||||
{"xdigit", "0123456789ABCDEFabcdef",
|
||||
""},
|
||||
{NULL, 0, ""}
|
||||
};
|
||||
@@ -1,102 +0,0 @@
|
||||
/* character-name table */
|
||||
static struct cname {
|
||||
char *name;
|
||||
char code;
|
||||
} cnames[] = {
|
||||
{"NUL", '\0'},
|
||||
{"SOH", '\001'},
|
||||
{"STX", '\002'},
|
||||
{"ETX", '\003'},
|
||||
{"EOT", '\004'},
|
||||
{"ENQ", '\005'},
|
||||
{"ACK", '\006'},
|
||||
{"BEL", '\007'},
|
||||
{"alert", '\007'},
|
||||
{"BS", '\010'},
|
||||
{"backspace", '\b'},
|
||||
{"HT", '\011'},
|
||||
{"tab", '\t'},
|
||||
{"LF", '\012'},
|
||||
{"newline", '\n'},
|
||||
{"VT", '\013'},
|
||||
{"vertical-tab", '\v'},
|
||||
{"FF", '\014'},
|
||||
{"form-feed", '\f'},
|
||||
{"CR", '\015'},
|
||||
{"carriage-return", '\r'},
|
||||
{"SO", '\016'},
|
||||
{"SI", '\017'},
|
||||
{"DLE", '\020'},
|
||||
{"DC1", '\021'},
|
||||
{"DC2", '\022'},
|
||||
{"DC3", '\023'},
|
||||
{"DC4", '\024'},
|
||||
{"NAK", '\025'},
|
||||
{"SYN", '\026'},
|
||||
{"ETB", '\027'},
|
||||
{"CAN", '\030'},
|
||||
{"EM", '\031'},
|
||||
{"SUB", '\032'},
|
||||
{"ESC", '\033'},
|
||||
{"IS4", '\034'},
|
||||
{"FS", '\034'},
|
||||
{"IS3", '\035'},
|
||||
{"GS", '\035'},
|
||||
{"IS2", '\036'},
|
||||
{"RS", '\036'},
|
||||
{"IS1", '\037'},
|
||||
{"US", '\037'},
|
||||
{"space", ' '},
|
||||
{"exclamation-mark", '!'},
|
||||
{"quotation-mark", '"'},
|
||||
{"number-sign", '#'},
|
||||
{"dollar-sign", '$'},
|
||||
{"percent-sign", '%'},
|
||||
{"ampersand", '&'},
|
||||
{"apostrophe", '\''},
|
||||
{"left-parenthesis", '('},
|
||||
{"right-parenthesis", ')'},
|
||||
{"asterisk", '*'},
|
||||
{"plus-sign", '+'},
|
||||
{"comma", ','},
|
||||
{"hyphen", '-'},
|
||||
{"hyphen-minus", '-'},
|
||||
{"period", '.'},
|
||||
{"full-stop", '.'},
|
||||
{"slash", '/'},
|
||||
{"solidus", '/'},
|
||||
{"zero", '0'},
|
||||
{"one", '1'},
|
||||
{"two", '2'},
|
||||
{"three", '3'},
|
||||
{"four", '4'},
|
||||
{"five", '5'},
|
||||
{"six", '6'},
|
||||
{"seven", '7'},
|
||||
{"eight", '8'},
|
||||
{"nine", '9'},
|
||||
{"colon", ':'},
|
||||
{"semicolon", ';'},
|
||||
{"less-than-sign", '<'},
|
||||
{"equals-sign", '='},
|
||||
{"greater-than-sign", '>'},
|
||||
{"question-mark", '?'},
|
||||
{"commercial-at", '@'},
|
||||
{"left-square-bracket", '['},
|
||||
{"backslash", '\\'},
|
||||
{"reverse-solidus", '\\'},
|
||||
{"right-square-bracket", ']'},
|
||||
{"circumflex", '^'},
|
||||
{"circumflex-accent", '^'},
|
||||
{"underscore", '_'},
|
||||
{"low-line", '_'},
|
||||
{"grave-accent", '`'},
|
||||
{"left-brace", '{'},
|
||||
{"left-curly-bracket", '{'},
|
||||
{"vertical-line", '|'},
|
||||
{"right-brace", '}'},
|
||||
{"right-curly-bracket", '}'},
|
||||
{"tilde", '~'},
|
||||
{"DEL", '\177'},
|
||||
{NULL, 0},
|
||||
};
|
||||
@@ -1,242 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "regex2.h"
|
||||
#include "debug.ih"
|
||||
|
||||
/*
|
||||
- regprint - print a regexp for debugging
|
||||
== void regprint(regex_t *r, FILE *d);
|
||||
*/
|
||||
void
|
||||
regprint(r, d)
|
||||
regex_t *r;
|
||||
FILE *d;
|
||||
{
|
||||
register struct re_guts *g = r->re_g;
|
||||
register int i;
|
||||
register int c;
|
||||
register int last;
|
||||
int nincat[NC];
|
||||
|
||||
fprintf(d, "%ld states, %d categories", (long)g->nstates,
|
||||
g->ncategories);
|
||||
fprintf(d, ", first %ld last %ld", (long)g->firststate,
|
||||
(long)g->laststate);
|
||||
if (g->iflags&USEBOL)
|
||||
fprintf(d, ", USEBOL");
|
||||
if (g->iflags&USEEOL)
|
||||
fprintf(d, ", USEEOL");
|
||||
if (g->iflags&BAD)
|
||||
fprintf(d, ", BAD");
|
||||
if (g->nsub > 0)
|
||||
fprintf(d, ", nsub=%ld", (long)g->nsub);
|
||||
if (g->must != NULL)
|
||||
fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen,
|
||||
g->must);
|
||||
if (g->backrefs)
|
||||
fprintf(d, ", backrefs");
|
||||
if (g->nplus > 0)
|
||||
fprintf(d, ", nplus %ld", (long)g->nplus);
|
||||
fprintf(d, "\n");
|
||||
s_print(g, d);
|
||||
for (i = 0; i < g->ncategories; i++) {
|
||||
nincat[i] = 0;
|
||||
for (c = CHAR_MIN; c <= CHAR_MAX; c++)
|
||||
if (g->categories[c] == i)
|
||||
nincat[i]++;
|
||||
}
|
||||
fprintf(d, "cc0#%d", nincat[0]);
|
||||
for (i = 1; i < g->ncategories; i++)
|
||||
if (nincat[i] == 1) {
|
||||
for (c = CHAR_MIN; c <= CHAR_MAX; c++)
|
||||
if (g->categories[c] == i)
|
||||
break;
|
||||
fprintf(d, ", %d=%s", i, regchar(c));
|
||||
}
|
||||
fprintf(d, "\n");
|
||||
for (i = 1; i < g->ncategories; i++)
|
||||
if (nincat[i] != 1) {
|
||||
fprintf(d, "cc%d\t", i);
|
||||
last = -1;
|
||||
for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */
|
||||
if (c <= CHAR_MAX && g->categories[c] == i) {
|
||||
if (last < 0) {
|
||||
fprintf(d, "%s", regchar(c));
|
||||
last = c;
|
||||
}
|
||||
} else {
|
||||
if (last >= 0) {
|
||||
if (last != c-1)
|
||||
fprintf(d, "-%s",
|
||||
regchar(c-1));
|
||||
last = -1;
|
||||
}
|
||||
}
|
||||
fprintf(d, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
- s_print - print the strip for debugging
|
||||
== static void s_print(register struct re_guts *g, FILE *d);
|
||||
*/
|
||||
static void
|
||||
s_print(g, d)
|
||||
register struct re_guts *g;
|
||||
FILE *d;
|
||||
{
|
||||
register sop *s;
|
||||
register cset *cs;
|
||||
register int i;
|
||||
register int done = 0;
|
||||
register sop opnd;
|
||||
register int col = 0;
|
||||
register int last;
|
||||
register sopno offset = 2;
|
||||
# define GAP() { if (offset % 5 == 0) { \
|
||||
if (col > 40) { \
|
||||
fprintf(d, "\n\t"); \
|
||||
col = 0; \
|
||||
} else { \
|
||||
fprintf(d, " "); \
|
||||
col++; \
|
||||
} \
|
||||
} else \
|
||||
col++; \
|
||||
offset++; \
|
||||
}
|
||||
|
||||
if (OP(g->strip[0]) != OEND)
|
||||
fprintf(d, "missing initial OEND!\n");
|
||||
for (s = &g->strip[1]; !done; s++) {
|
||||
opnd = OPND(*s);
|
||||
switch (OP(*s)) {
|
||||
case OEND:
|
||||
fprintf(d, "\n");
|
||||
done = 1;
|
||||
break;
|
||||
case OCHAR:
|
||||
if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL)
|
||||
fprintf(d, "\\%c", (unsigned char)opnd);
|
||||
else
|
||||
fprintf(d, "%s", regchar((unsigned char)opnd));
|
||||
break;
|
||||
case OBOL:
|
||||
fprintf(d, "^");
|
||||
break;
|
||||
case OEOL:
|
||||
fprintf(d, "$");
|
||||
break;
|
||||
case OBOW:
|
||||
fprintf(d, "\\{");
|
||||
break;
|
||||
case OEOW:
|
||||
fprintf(d, "\\}");
|
||||
break;
|
||||
case OANY:
|
||||
fprintf(d, ".");
|
||||
break;
|
||||
case OANYOF:
|
||||
fprintf(d, "[(%ld)", (long)opnd);
|
||||
cs = &g->sets[opnd];
|
||||
last = -1;
|
||||
for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */
|
||||
if (CHIN(cs, i) && i < g->csetsize) {
|
||||
if (last < 0) {
|
||||
fprintf(d, "%s", regchar(i));
|
||||
last = i;
|
||||
}
|
||||
} else {
|
||||
if (last >= 0) {
|
||||
if (last != i-1)
|
||||
fprintf(d, "-%s",
|
||||
regchar(i-1));
|
||||
last = -1;
|
||||
}
|
||||
}
|
||||
fprintf(d, "]");
|
||||
break;
|
||||
case OBACK_:
|
||||
fprintf(d, "(\\<%ld>", (long)opnd);
|
||||
break;
|
||||
case O_BACK:
|
||||
fprintf(d, "<%ld>\\)", (long)opnd);
|
||||
break;
|
||||
case OPLUS_:
|
||||
fprintf(d, "(+");
|
||||
if (OP(*(s+opnd)) != O_PLUS)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
break;
|
||||
case O_PLUS:
|
||||
if (OP(*(s-opnd)) != OPLUS_)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
fprintf(d, "+)");
|
||||
break;
|
||||
case OQUEST_:
|
||||
fprintf(d, "(?");
|
||||
if (OP(*(s+opnd)) != O_QUEST)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
break;
|
||||
case O_QUEST:
|
||||
if (OP(*(s-opnd)) != OQUEST_)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
fprintf(d, "?)");
|
||||
break;
|
||||
case OLPAREN:
|
||||
fprintf(d, "((<%ld>", (long)opnd);
|
||||
break;
|
||||
case ORPAREN:
|
||||
fprintf(d, "<%ld>))", (long)opnd);
|
||||
break;
|
||||
case OCH_:
|
||||
fprintf(d, "<");
|
||||
if (OP(*(s+opnd)) != OOR2)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
break;
|
||||
case OOR1:
|
||||
if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
fprintf(d, "|");
|
||||
break;
|
||||
case OOR2:
|
||||
fprintf(d, "|");
|
||||
if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
break;
|
||||
case O_CH:
|
||||
if (OP(*(s-opnd)) != OOR1)
|
||||
fprintf(d, "<%ld>", (long)opnd);
|
||||
fprintf(d, ">");
|
||||
break;
|
||||
default:
|
||||
fprintf(d, "!%ld(%ld)!", OP(*s), opnd);
|
||||
break;
|
||||
}
|
||||
if (!done)
|
||||
GAP();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
- regchar - make a character printable
|
||||
== static char *regchar(int ch);
|
||||
*/
|
||||
static unsigned char * /* -> representation */
|
||||
regchar(ch)
|
||||
int ch;
|
||||
{
|
||||
static unsigned char buf[10];
|
||||
|
||||
if (isprint(ch) || ch == ' ')
|
||||
sprintf(buf, "%c", ch);
|
||||
else
|
||||
sprintf(buf, "\\%o", ch);
|
||||
return(buf);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === debug.c === */
|
||||
void regprint(regex_t *r, FILE *d);
|
||||
static void s_print(register struct re_guts *g, FILE *d);
|
||||
static char *regchar(int ch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,35 +0,0 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === engine.c === */
|
||||
static int matcher(register struct re_guts *g, unsigned char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
static unsigned char *dissect(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static unsigned char *backref(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
static unsigned char *fast(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static unsigned char *slow(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft);
|
||||
#define BOL (OUT+1)
|
||||
#define EOL (BOL+1)
|
||||
#define BOLEOL (BOL+2)
|
||||
#define NOTHING (BOL+3)
|
||||
#define BOW (BOL+4)
|
||||
#define EOW (BOL+5)
|
||||
#define CODEMAX (BOL+5) /* highest code used */
|
||||
#define NONCHAR(c) ((c) > UCHAR_MAX)
|
||||
#define NNONCHAR (CODEMAX-UCHAR_MAX)
|
||||
#ifdef REDEBUG
|
||||
static void print(struct match *m, unsigned char *caption, states st, int ch, FILE *d);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static unsigned char *pchar(int ch);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
@@ -1,510 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "main.ih"
|
||||
|
||||
char *progname;
|
||||
int debug = 0;
|
||||
int line = 0;
|
||||
int status = 0;
|
||||
|
||||
int copts = REG_EXTENDED;
|
||||
int eopts = 0;
|
||||
regoff_t startoff = 0;
|
||||
regoff_t endoff = 0;
|
||||
|
||||
|
||||
extern int split();
|
||||
extern void regprint();
|
||||
|
||||
/*
|
||||
- main - do the simple case, hand off to regress() for regression
|
||||
*/
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
regex_t re;
|
||||
# define NS 10
|
||||
regmatch_t subs[NS];
|
||||
char erbuf[100];
|
||||
int err;
|
||||
size_t len;
|
||||
int c;
|
||||
int errflg = 0;
|
||||
register int i;
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
|
||||
progname = argv[0];
|
||||
|
||||
while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF)
|
||||
switch (c) {
|
||||
case 'c': /* compile options */
|
||||
copts = options('c', optarg);
|
||||
break;
|
||||
case 'e': /* execute options */
|
||||
eopts = options('e', optarg);
|
||||
break;
|
||||
case 'S': /* start offset */
|
||||
startoff = (regoff_t)atoi(optarg);
|
||||
break;
|
||||
case 'E': /* end offset */
|
||||
endoff = (regoff_t)atoi(optarg);
|
||||
break;
|
||||
case 'x': /* Debugging. */
|
||||
debug++;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
errflg++;
|
||||
break;
|
||||
}
|
||||
if (errflg) {
|
||||
fprintf(stderr, "usage: %s ", progname);
|
||||
fprintf(stderr, "[-c copt][-C][-d] [re]\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if (optind >= argc) {
|
||||
regress(stdin);
|
||||
exit(status);
|
||||
}
|
||||
|
||||
err = regcomp(&re, argv[optind++], copts);
|
||||
if (err) {
|
||||
len = regerror(err, &re, erbuf, sizeof(erbuf));
|
||||
fprintf(stderr, "error %s, %d/%d `%s'\n",
|
||||
eprint(err), len, sizeof(erbuf), erbuf);
|
||||
exit(status);
|
||||
}
|
||||
regprint(&re, stdout);
|
||||
|
||||
if (optind >= argc) {
|
||||
regfree(&re);
|
||||
exit(status);
|
||||
}
|
||||
|
||||
if (eopts®_STARTEND) {
|
||||
subs[0].rm_so = startoff;
|
||||
subs[0].rm_eo = strlen(argv[optind]) - endoff;
|
||||
}
|
||||
err = regexec(&re, argv[optind], (size_t)NS, subs, eopts);
|
||||
if (err) {
|
||||
len = regerror(err, &re, erbuf, sizeof(erbuf));
|
||||
fprintf(stderr, "error %s, %d/%d `%s'\n",
|
||||
eprint(err), len, sizeof(erbuf), erbuf);
|
||||
exit(status);
|
||||
}
|
||||
if (!(copts®_NOSUB)) {
|
||||
len = (int)(subs[0].rm_eo - subs[0].rm_so);
|
||||
if (subs[0].rm_so != -1) {
|
||||
if (len != 0)
|
||||
printf("match `%.*s'\n", (int)len,
|
||||
argv[optind] + subs[0].rm_so);
|
||||
else
|
||||
printf("match `'@%.1s\n",
|
||||
argv[optind] + subs[0].rm_so);
|
||||
}
|
||||
for (i = 1; i < NS; i++)
|
||||
if (subs[i].rm_so != -1)
|
||||
printf("(%d) `%.*s'\n", i,
|
||||
(int)(subs[i].rm_eo - subs[i].rm_so),
|
||||
argv[optind] + subs[i].rm_so);
|
||||
}
|
||||
exit(status);
|
||||
}
|
||||
|
||||
/*
|
||||
- regress - main loop of regression test
|
||||
== void regress(FILE *in);
|
||||
*/
|
||||
void
|
||||
regress(in)
|
||||
FILE *in;
|
||||
{
|
||||
char inbuf[1000];
|
||||
# define MAXF 10
|
||||
char *f[MAXF];
|
||||
int nf;
|
||||
int i;
|
||||
char erbuf[100];
|
||||
size_t ne;
|
||||
char *badpat = "invalid regular expression";
|
||||
# define SHORT 10
|
||||
char *bpname = "REG_BADPAT";
|
||||
regex_t re;
|
||||
|
||||
while (fgets(inbuf, sizeof(inbuf), in) != NULL) {
|
||||
line++;
|
||||
if (inbuf[0] == '#' || inbuf[0] == '\n')
|
||||
continue; /* NOTE CONTINUE */
|
||||
inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */
|
||||
if (debug)
|
||||
fprintf(stdout, "%d:\n", line);
|
||||
nf = split(inbuf, f, MAXF, "\t\t");
|
||||
if (nf < 3) {
|
||||
fprintf(stderr, "bad input, line %d\n", line);
|
||||
exit(1);
|
||||
}
|
||||
for (i = 0; i < nf; i++)
|
||||
if (strcmp(f[i], "\"\"") == 0)
|
||||
f[i] = "";
|
||||
if (nf <= 3)
|
||||
f[3] = NULL;
|
||||
if (nf <= 4)
|
||||
f[4] = NULL;
|
||||
try(f[0], f[1], f[2], f[3], f[4], options('c', f[1]));
|
||||
if (opt('&', f[1])) /* try with either type of RE */
|
||||
try(f[0], f[1], f[2], f[3], f[4],
|
||||
options('c', f[1]) &~ REG_EXTENDED);
|
||||
}
|
||||
|
||||
ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf));
|
||||
if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) {
|
||||
fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n",
|
||||
erbuf, badpat);
|
||||
status = 1;
|
||||
}
|
||||
ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT);
|
||||
if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' ||
|
||||
ne != strlen(badpat)+1) {
|
||||
fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n",
|
||||
erbuf, SHORT-1, badpat);
|
||||
status = 1;
|
||||
}
|
||||
ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf));
|
||||
if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) {
|
||||
fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n",
|
||||
erbuf, bpname);
|
||||
status = 1;
|
||||
}
|
||||
re.re_endp = bpname;
|
||||
ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf));
|
||||
if (atoi(erbuf) != (int)REG_BADPAT) {
|
||||
fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n",
|
||||
erbuf, (long)REG_BADPAT);
|
||||
status = 1;
|
||||
} else if (ne != strlen(erbuf)+1) {
|
||||
fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n",
|
||||
erbuf, (long)REG_BADPAT);
|
||||
status = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
- try - try it, and report on problems
|
||||
== void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts);
|
||||
*/
|
||||
void
|
||||
try(f0, f1, f2, f3, f4, opts)
|
||||
char *f0;
|
||||
char *f1;
|
||||
char *f2;
|
||||
char *f3;
|
||||
char *f4;
|
||||
int opts; /* may not match f1 */
|
||||
{
|
||||
regex_t re;
|
||||
# define NSUBS 10
|
||||
regmatch_t subs[NSUBS];
|
||||
# define NSHOULD 15
|
||||
char *should[NSHOULD];
|
||||
int nshould;
|
||||
char erbuf[100];
|
||||
int err;
|
||||
int len;
|
||||
char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE";
|
||||
register int i;
|
||||
char *grump;
|
||||
char f0copy[1000];
|
||||
char f2copy[1000];
|
||||
|
||||
strcpy(f0copy, f0);
|
||||
re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL;
|
||||
fixstr(f0copy);
|
||||
err = regcomp(&re, f0copy, opts);
|
||||
if (err != 0 && (!opt('C', f1) || err != efind(f2))) {
|
||||
/* unexpected error or wrong error */
|
||||
len = regerror(err, &re, erbuf, sizeof(erbuf));
|
||||
fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n",
|
||||
line, type, eprint(err), len,
|
||||
sizeof(erbuf), erbuf);
|
||||
status = 1;
|
||||
} else if (err == 0 && opt('C', f1)) {
|
||||
/* unexpected success */
|
||||
fprintf(stderr, "%d: %s should have given REG_%s\n",
|
||||
line, type, f2);
|
||||
status = 1;
|
||||
err = 1; /* so we won't try regexec */
|
||||
}
|
||||
|
||||
if (err != 0) {
|
||||
regfree(&re);
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy(f2copy, f2);
|
||||
fixstr(f2copy);
|
||||
|
||||
if (options('e', f1)®_STARTEND) {
|
||||
if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL)
|
||||
fprintf(stderr, "%d: bad STARTEND syntax\n", line);
|
||||
subs[0].rm_so = strchr(f2, '(') - f2 + 1;
|
||||
subs[0].rm_eo = strchr(f2, ')') - f2;
|
||||
}
|
||||
err = regexec(&re, f2copy, NSUBS, subs, options('e', f1));
|
||||
|
||||
if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) {
|
||||
/* unexpected error or wrong error */
|
||||
len = regerror(err, &re, erbuf, sizeof(erbuf));
|
||||
fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n",
|
||||
line, type, eprint(err), len,
|
||||
sizeof(erbuf), erbuf);
|
||||
status = 1;
|
||||
} else if (err != 0) {
|
||||
/* nothing more to check */
|
||||
} else if (f3 == NULL) {
|
||||
/* unexpected success */
|
||||
fprintf(stderr, "%d: %s exec should have failed\n",
|
||||
line, type);
|
||||
status = 1;
|
||||
err = 1; /* just on principle */
|
||||
} else if (opts®_NOSUB) {
|
||||
/* nothing more to check */
|
||||
} else if ((grump = check(f2, subs[0], f3)) != NULL) {
|
||||
fprintf(stderr, "%d: %s %s\n", line, type, grump);
|
||||
status = 1;
|
||||
err = 1;
|
||||
}
|
||||
|
||||
if (err != 0 || f4 == NULL) {
|
||||
regfree(&re);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 1; i < NSHOULD; i++)
|
||||
should[i] = NULL;
|
||||
nshould = split(f4, should+1, NSHOULD-1, ",");
|
||||
if (nshould == 0) {
|
||||
nshould = 1;
|
||||
should[1] = "";
|
||||
}
|
||||
for (i = 1; i < NSUBS; i++) {
|
||||
grump = check(f2, subs[i], should[i]);
|
||||
if (grump != NULL) {
|
||||
fprintf(stderr, "%d: %s $%d %s\n", line,
|
||||
type, i, grump);
|
||||
status = 1;
|
||||
err = 1;
|
||||
}
|
||||
}
|
||||
|
||||
regfree(&re);
|
||||
}
|
||||
|
||||
/*
|
||||
- options - pick options out of a regression-test string
|
||||
== int options(int type, char *s);
|
||||
*/
|
||||
int
|
||||
options(type, s)
|
||||
int type; /* 'c' compile, 'e' exec */
|
||||
char *s;
|
||||
{
|
||||
register char *p;
|
||||
register int o = (type == 'c') ? copts : eopts;
|
||||
register char *legal = (type == 'c') ? "bisnmp" : "^$#tl";
|
||||
|
||||
for (p = s; *p != '\0'; p++)
|
||||
if (strchr(legal, *p) != NULL)
|
||||
switch (*p) {
|
||||
case 'b':
|
||||
o &= ~REG_EXTENDED;
|
||||
break;
|
||||
case 'i':
|
||||
o |= REG_ICASE;
|
||||
break;
|
||||
case 's':
|
||||
o |= REG_NOSUB;
|
||||
break;
|
||||
case 'n':
|
||||
o |= REG_NEWLINE;
|
||||
break;
|
||||
case 'm':
|
||||
o &= ~REG_EXTENDED;
|
||||
o |= REG_NOSPEC;
|
||||
break;
|
||||
case 'p':
|
||||
o |= REG_PEND;
|
||||
break;
|
||||
case '^':
|
||||
o |= REG_NOTBOL;
|
||||
break;
|
||||
case '$':
|
||||
o |= REG_NOTEOL;
|
||||
break;
|
||||
case '#':
|
||||
o |= REG_STARTEND;
|
||||
break;
|
||||
case 't': /* trace */
|
||||
o |= REG_TRACE;
|
||||
break;
|
||||
case 'l': /* force long representation */
|
||||
o |= REG_LARGE;
|
||||
break;
|
||||
case 'r': /* force backref use */
|
||||
o |= REG_BACKR;
|
||||
break;
|
||||
}
|
||||
return(o);
|
||||
}
|
||||
|
||||
/*
|
||||
- opt - is a particular option in a regression string?
|
||||
== int opt(int c, char *s);
|
||||
*/
|
||||
int /* predicate */
|
||||
opt(c, s)
|
||||
int c;
|
||||
char *s;
|
||||
{
|
||||
return(strchr(s, c) != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
- fixstr - transform magic characters in strings
|
||||
== void fixstr(register char *p);
|
||||
*/
|
||||
void
|
||||
fixstr(p)
|
||||
register char *p;
|
||||
{
|
||||
if (p == NULL)
|
||||
return;
|
||||
|
||||
for (; *p != '\0'; p++)
|
||||
if (*p == 'N')
|
||||
*p = '\n';
|
||||
else if (*p == 'T')
|
||||
*p = '\t';
|
||||
else if (*p == 'S')
|
||||
*p = ' ';
|
||||
else if (*p == 'Z')
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
- check - check a substring match
|
||||
== char *check(char *str, regmatch_t sub, char *should);
|
||||
*/
|
||||
char * /* NULL or complaint */
|
||||
check(str, sub, should)
|
||||
char *str;
|
||||
regmatch_t sub;
|
||||
char *should;
|
||||
{
|
||||
register int len;
|
||||
register int shlen;
|
||||
register char *p;
|
||||
static char grump[500];
|
||||
register char *at = NULL;
|
||||
|
||||
if (should != NULL && strcmp(should, "-") == 0)
|
||||
should = NULL;
|
||||
if (should != NULL && should[0] == '@') {
|
||||
at = should + 1;
|
||||
should = "";
|
||||
}
|
||||
|
||||
/* check rm_so and rm_eo for consistency */
|
||||
if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) ||
|
||||
(sub.rm_so != -1 && sub.rm_eo == -1) ||
|
||||
(sub.rm_so != -1 && sub.rm_so < 0) ||
|
||||
(sub.rm_eo != -1 && sub.rm_eo < 0) ) {
|
||||
sprintf(grump, "start %ld end %ld", (long)sub.rm_so,
|
||||
(long)sub.rm_eo);
|
||||
return(grump);
|
||||
}
|
||||
|
||||
/* check for no match */
|
||||
if (sub.rm_so == -1 && should == NULL)
|
||||
return(NULL);
|
||||
if (sub.rm_so == -1)
|
||||
return("did not match");
|
||||
|
||||
/* check for in range */
|
||||
if (sub.rm_eo > strlen(str)) {
|
||||
sprintf(grump, "start %ld end %ld, past end of string",
|
||||
(long)sub.rm_so, (long)sub.rm_eo);
|
||||
return(grump);
|
||||
}
|
||||
|
||||
len = (int)(sub.rm_eo - sub.rm_so);
|
||||
shlen = (int)strlen(should);
|
||||
p = str + sub.rm_so;
|
||||
|
||||
/* check for not supposed to match */
|
||||
if (should == NULL) {
|
||||
sprintf(grump, "matched `%.*s'", len, p);
|
||||
return(grump);
|
||||
}
|
||||
|
||||
/* check for wrong match */
|
||||
if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) {
|
||||
sprintf(grump, "matched `%.*s' instead", len, p);
|
||||
return(grump);
|
||||
}
|
||||
if (shlen > 0)
|
||||
return(NULL);
|
||||
|
||||
/* check null match in right place */
|
||||
if (at == NULL)
|
||||
return(NULL);
|
||||
shlen = strlen(at);
|
||||
if (shlen == 0)
|
||||
shlen = 1; /* force check for end-of-string */
|
||||
if (strncmp(p, at, shlen) != 0) {
|
||||
sprintf(grump, "matched null at `%.20s'", p);
|
||||
return(grump);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
- eprint - convert error number to name
|
||||
== static char *eprint(int err);
|
||||
*/
|
||||
static char *
|
||||
eprint(err)
|
||||
int err;
|
||||
{
|
||||
static char epbuf[100];
|
||||
size_t len;
|
||||
|
||||
len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf));
|
||||
assert(len <= sizeof(epbuf));
|
||||
return(epbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
- efind - convert error name to number
|
||||
== static int efind(char *name);
|
||||
*/
|
||||
static int
|
||||
efind(name)
|
||||
char *name;
|
||||
{
|
||||
static char efbuf[100];
|
||||
regex_t re;
|
||||
|
||||
sprintf(efbuf, "REG_%s", name);
|
||||
assert(strlen(efbuf) < sizeof(efbuf));
|
||||
re.re_endp = efbuf;
|
||||
(void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf));
|
||||
return(atoi(efbuf));
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === main.c === */
|
||||
void regress(FILE *in);
|
||||
void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts);
|
||||
int options(int type, char *s);
|
||||
int opt(int c, char *s);
|
||||
void fixstr(register char *p);
|
||||
char *check(char *str, regmatch_t sub, char *should);
|
||||
static char *eprint(int err);
|
||||
static int efind(char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
@@ -1,76 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkh - pull headers out of C source
|
||||
PATH=/bin:/usr/bin ; export PATH
|
||||
|
||||
# egrep pattern to pick out marked lines
|
||||
egrep='^ =([ ]|$)'
|
||||
|
||||
# Sed program to process marked lines into lines for the header file.
|
||||
# The markers have already been removed. Two things are done here: removal
|
||||
# of backslashed newlines, and some fudging of comments. The first is done
|
||||
# because -o needs to have prototypes on one line to strip them down.
|
||||
# Getting comments into the output is tricky; we turn C++-style // comments
|
||||
# into /* */ comments, after altering any existing */'s to avoid trouble.
|
||||
peel=' /\\$/N
|
||||
/\\\n[ ]*/s///g
|
||||
/\/\//s;\*/;* /;g
|
||||
/\/\//s;//\(.*\);/*\1 */;'
|
||||
|
||||
for a
|
||||
do
|
||||
case "$a" in
|
||||
-o) # old (pre-function-prototype) compiler
|
||||
# add code to comment out argument lists
|
||||
peel="$peel
|
||||
"'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1(/*\2*/);'
|
||||
shift
|
||||
;;
|
||||
-b) # funny Berkeley __P macro
|
||||
peel="$peel
|
||||
"'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 __P((\2));'
|
||||
shift
|
||||
;;
|
||||
-s) # compiler doesn't like `static foo();'
|
||||
# add code to get rid of the `static'
|
||||
peel="$peel
|
||||
"'/^static[ ][^\/]*[a-zA-Z0-9_)](.*)/s;static.;;'
|
||||
shift
|
||||
;;
|
||||
-p) # private declarations
|
||||
egrep='^ ==([ ]|$)'
|
||||
shift
|
||||
;;
|
||||
-i) # wrap in #ifndef, argument is name
|
||||
ifndef="$2"
|
||||
shift ; shift
|
||||
;;
|
||||
*) break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test " $ifndef" != " "
|
||||
then
|
||||
echo "#ifndef $ifndef"
|
||||
echo "#define $ifndef /* never again */"
|
||||
fi
|
||||
echo "/* ========= begin header generated by $0 ========= */"
|
||||
echo '#ifdef __cplusplus'
|
||||
echo 'extern "C" {'
|
||||
echo '#endif'
|
||||
for f
|
||||
do
|
||||
echo
|
||||
echo "/* === $f === */"
|
||||
egrep "$egrep" $f | sed 's/^ ==*[ ]//;s/^ ==*$//' | sed "$peel"
|
||||
echo
|
||||
done
|
||||
echo '#ifdef __cplusplus'
|
||||
echo '}'
|
||||
echo '#endif'
|
||||
echo "/* ========= end header generated by $0 ========= */"
|
||||
if test " $ifndef" != " "
|
||||
then
|
||||
echo "#endif"
|
||||
fi
|
||||
exit 0
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,53 +0,0 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === regcomp.c === */
|
||||
static void p_ere(register struct parse *p, int stop);
|
||||
static void p_ere_exp(register struct parse *p);
|
||||
static void p_str(register struct parse *p);
|
||||
static void p_bre(register struct parse *p, register int end1, register int end2);
|
||||
static int p_simp_re(register struct parse *p, int starordinary);
|
||||
static int p_count(register struct parse *p);
|
||||
static void p_bracket(register struct parse *p);
|
||||
static void p_b_term(register struct parse *p, register cset *cs);
|
||||
static void p_b_cclass(register struct parse *p, register cset *cs);
|
||||
static void p_b_eclass(register struct parse *p, register cset *cs);
|
||||
static unsigned char p_b_symbol(register struct parse *p);
|
||||
static unsigned char p_b_coll_elem(register struct parse *p, int endc);
|
||||
static unsigned char othercase(int ch);
|
||||
static void bothcases(register struct parse *p, int ch);
|
||||
static void ordinary(register struct parse *p, register int ch);
|
||||
static void nonnewline(register struct parse *p);
|
||||
static void repeat(register struct parse *p, sopno start, int from, int to);
|
||||
static int seterr(register struct parse *p, int e);
|
||||
static cset *allocset(register struct parse *p);
|
||||
static void freeset(register struct parse *p, register cset *cs);
|
||||
static int freezeset(register struct parse *p, register cset *cs);
|
||||
static int firstch(register struct parse *p, register cset *cs);
|
||||
static int nch(register struct parse *p, register cset *cs);
|
||||
static void mcadd(register struct parse *p, register cset *cs, register unsigned char *cp);
|
||||
#if 0
|
||||
static void mcsub(register cset *cs, register unsigned char *cp);
|
||||
static int mcin(register cset *cs, register unsigned char *cp);
|
||||
static unsigned char *mcfind(register cset *cs, register unsigned char *cp);
|
||||
#endif
|
||||
static void mcinvert(register struct parse *p, register cset *cs);
|
||||
static void mccase(register struct parse *p, register cset *cs);
|
||||
static int isinsets(register struct re_guts *g, int c);
|
||||
static int samesets(register struct re_guts *g, int c1, int c2);
|
||||
static void categorize(struct parse *p, register struct re_guts *g);
|
||||
static sopno dupl(register struct parse *p, sopno start, sopno finish);
|
||||
static void doemit(register struct parse *p, sop op, size_t opnd);
|
||||
static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos);
|
||||
static void dofwd(register struct parse *p, sopno pos, sop value);
|
||||
static void enlarge(register struct parse *p, sopno size);
|
||||
static void stripsnug(register struct parse *p, register struct re_guts *g);
|
||||
static void findmust(register struct parse *p, register struct re_guts *g);
|
||||
static sopno pluscount(register struct parse *p, register struct re_guts *g);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
Loaded 100 of 724 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user