12523 Commits

Author SHA1 Message Date
Christian Persch
9c885d6dfd regex: Add JIT support 2012-06-29 20:03:17 +02:00
Christian Persch
0f4022919e regex: Import PCRE JIT code 2012-06-29 09:01:50 +02:00
Christian Persch
2fac72a29e regex: Add accessor to get max length of lookbehind characters
Use PCRE_INFO_MAXLOOKBEHIND to get the length (in characters) of the
longest lookbehind assertion in the pattern.
2012-06-29 09:01:50 +02:00
Christian Persch
37162259fd regex: Add new GRegexError code from PCRE 8.31 2012-06-29 09:01:49 +02:00
Christian Persch
fb0d4ef43b regex: Enable fixed test
This problem was fixed in PCRE 8.31, so uncomment the test.
2012-06-29 09:01:49 +02:00
Christian Persch
2e137e6899 regex: Import PCRE 8.31-RC2 2012-06-29 09:01:40 +02:00
Christian Persch
bd4b93e6b0 regex: Fix unicode othercasing
Reorder the toupper/tolower calls when othercaseing, so this
function is bug-for-bug compatible with the pcre internal tables.

https://bugzilla.gnome.org/show_bug.cgi?id=678273
2012-06-28 22:17:21 +02:00
Christian Persch
e1d0b15b49 regex: Add FIRSTLINE compile flag
This option exists since PCRE 6.0.
2012-06-28 22:08:17 +02:00
Christian Persch
d9936f9dbd regex: Add NO_START_OPTIMIZE compile and match flags
PCRE_NO_START_OPTIMIZE exists since PCRE 7.9, but was not usefully before
since it only affects callout (which GRegex doesn't support) and backtracking
control verbs which the last commit makes use of.
2012-06-28 22:08:17 +02:00
Christian Persch
1c029158f6 regex: Add g_match_info_get_mark
Since PCRE 8.03, PCRE supports backtracking control verbs with a name argument.
g_match_info_get_mark() will return the argument of the last encountered verb
in the whole matching process for failed or partial matches, and in the matching
path only for matches.
2012-06-28 22:08:17 +02:00
Christian Persch
6ccdc3379d regex: Add NOTEMPTY_ATSTART match option
Since PCRE 8.00 it supports a variant of PCRE_NOTEMPTY that works
similarly except that it only applies to the start of the matched string
but permits empty matches further in.
2012-06-28 22:08:17 +02:00
Christian Persch
d61b475f89 regex: Add PARTIAL_HARD match option
Since PCRE 8.00 it supports a new partial matching method PCRE_PARTIAL_HARD.
2012-06-28 22:08:17 +02:00
Christian Persch
c28a9ed498 regex: Add JavaScript compat mode
Since PCRE 7.7, there's a flag that changes the behaviour to be more
JavaScript compatible. Since it's no effort to expose it, just do so.
2012-06-28 22:08:17 +02:00
Christian Persch
5ebea3c467 regex: Don't leak internal PCRE options
g_regex_get_compile_get_compile_flags() and g_regex_get_match_flags()
were leaking PCRE flags that don't exist in the corresponding
public GRegexCompileFlags and GRegexMatchFlags; this change masks
these internal flags.
2012-06-28 22:08:17 +02:00
Christian Persch
711e7481c1 regex: Add BSR_ANYCRLF and BSR_ANY match options
These flags override the compile option at match time. They use PCRE_BSR_ANYCRLF
and PCRE_BSR_UNICODE, resp., which make \R match only CR, LF and CRLF, or any
Unicode newline character or character sequences, resp.
2012-06-28 22:08:17 +02:00
Christian Persch
18ffc0c806 regex: Add BSR_ANYCRLF compile option
When this flag is set, \R only matches CR, LF and CRLF.
2012-06-28 22:08:17 +02:00
Christian Persch
8508f57110 regex: Fix newline definition for system PCRE
While we PCRE_BSR_UNICODE is the default in the internal PCRE, that may
not be true for the system one. Force the PCRE_BSR_UNICODE flag on it.
2012-06-28 22:08:17 +02:00
Christian Persch
93a7867879 regex: Don't return from inside a g_once_init_enter/leave block
When using the system PCRE, and it was compiled with incompatible options,
the code was returning from inside a g_once_init_enter/leave block without
calling g_once_init_leave().
2012-06-28 22:08:17 +02:00
Christian Persch
591d41ef1f regex: Add accessor for PCRE_INFO_HASCRORLF
This flag is new in PCRE 7.3, and checks whether there is an explicit
CR or LF reference in the pattern.
2012-06-28 22:08:16 +02:00
Christian Persch
73f5555e3a regex: Remove message for unused error code
Since PCRE 7.3 the PCRE_ERROR_NULLWSLIMIT error is not returned anymore.
2012-06-28 22:08:16 +02:00
Christian Persch
0101317703 regex: Add NEWLINE_ANYCRLF match option
This PCRE option is new in PCRE 7.1.
2012-06-28 22:08:16 +02:00
Christian Persch
f01b8723a7 regex: Add NEWLINE_ANYCRLF compile option
The PCRE_NEWLINE_ANYCRLF option is new in PCRE 7.1. With it set, the only
only newline sequences recognised are CR, LF and CRLF.
2012-06-28 22:08:16 +02:00
Christian Persch
b90c23bdaf regex: Assert that our flags values are the same as PCRE's
We rely on those flags having the same values as PCRE's (so we can pass
them right through), so assert this at compile time.
2012-06-28 22:08:16 +02:00
Christian Persch
04e7f4349f regex: Handle PCRE_ERROR_RECURSIONLOOP
Was missing from the error conversion routine.
2012-06-28 22:08:16 +02:00
Christian Persch
115076d841 regex: Update GRegexError with newer PCRE error codes
Update the GRegexError enum with new PCRE errors up to PCRE 8.30.

https://bugzilla.gnome.org/show_bug.cgi?id=677579
2012-06-28 22:08:16 +02:00
Christian Persch
340058d242 regex: Simplify regex compile tests
Use a macro instead of repeating the same code over and over again.
2012-06-28 22:08:16 +02:00
Christian Persch
c0fbb1374f regex: Deprecate an obsolete error code
G_REGEX_ERROR_DEFINE_REPETION is dead and never raised by PCRE.
2012-06-28 22:08:16 +02:00
Christian Persch
fb088b9f4b regex: Fix PCRE error code conversion
Use the shifted error codes for comparisions.

https://bugzilla.gnome.org/show_bug.cgi?id=677578
2012-06-28 22:08:15 +02:00
Tom Tryfonidis
df319ca49c Updated Greek translation 2012-06-28 17:44:14 +03:00
Martin Pitt
d023b81a7a Fix /contenttype/guess test
After fixing bug 674452 this test case now reliably fails, as "ABC abc" is text
and definitively not PowerPoint. It previously worked as g_content_type_guess()
was reading beyond the boundary of the data due to specifying -1 as data
length.

Update that test case to expect a PO template instead, and add two more with a
definitive PO template syntax and some binary data. We do not currently have a
MIME magic for PowerPoint, so we cannot actually detect it with certainty, but
at least make sure that the returned MIME type is correct.

https://bugzilla.gnome.org/show_bug.cgi?id=678941
2012-06-28 15:57:22 +02:00
Alexander Larsson
c35106fcc4 Fix the mimetype default fix
We need to ignore the defaults.list item only when there
was a mimetype handler found in a previous mimetype, not
if one was found for the same mimetype as the one that
is listed in defaults.list (same for the new-style defaults).
2012-06-28 15:38:06 +02:00
Alexander Larsson
f14c0112d0 Fix default app lookup wrt parent types and defaults.list
There was an issue when looking up the default handler
for a type where a supertype was listed in defaults.list.
We would pick the default for the parent type even if
there was a handler for the more specific type.

In the case of the new-style defaults marking (
"Default Applications" in mimeapps.list) we were already
checking for a more specific handler befor using a default,
but we also need to do a similar check for the defaults.list
case.

https://bugzilla.gnome.org/show_bug.cgi?id=678944
2012-06-28 15:05:03 +02:00
Stef Walter
1ae3080640 GTlsInteraction: Fix incorrect locking of mutex
* Fix incorrect locking of mutex in g_tls_interaction_invoke_ask_password()

https://bugzilla.gnome.org/show_bug.cgi?id=678758
2012-06-28 14:43:12 +02:00
Martin Pitt
139c1ce988 gio/tests/contenttype: Call g_content_type_guess() with valid data len
g_content_type_guess() requires specifying a valid data length. Fixes a
segfault when running the test.

Also add an explicit check for this and return XDG_MIME_TYPE_UNKNOWN when
data_size is specified as -1, to avoid crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=674452
2012-06-27 16:00:27 +02:00
Martin Pitt
95f29687e1 /mainloop/timeouts test: Reduce race condition
Due to load, particular traits of the architecture, or other circumstances, the
/mainloop/timeouts sometimes manages to call the "every
100 ms" timer loop only 9 times in 1050 ms.

This is an inherent race-condition in the test; allow it some slack and accept
9 times as well.

https://bugzilla.gnome.org/show_bug.cgi?id=678959
2012-06-27 15:32:38 +02:00
Philipp Kern
240ef2b9e8 valuetransform: Fix definition of ulong_bool
On big endian 64 bit machines such as s390x, an uint is too small to hold a
ulong_bool; it needs to be an actual ulong.

https://bugzilla.gnome.org/show_bug.cgi?id=678949
http://bugs.debian.org/662057
2012-06-27 10:59:29 +02:00
Alexander Shopov
c5e5e95a21 Updated Bulgarian translation 2012-06-27 07:17:40 +03:00
Martin Pitt
72af44cb12 Allow slightly too small poll duration in /socket/timed_wait test
Sometimes the poll duration in the /socket/timed_wait test is slightly lower
than the requested 100000, causing failures like

ERROR:/build/buildd/glib2.0-2.33.2/./gio/tests/socket.c:619:test_timed_wait:
  assertion failed (poll_duration > = 100000): (99240 >= 100000)
FAIL

Adjust the test to also allow some jitter in the "too small" direction, similar
to the already existing span for "slightly too large".

https://bugzilla.gnome.org/show_bug.cgi?id=678881
2012-06-26 18:34:08 +02:00
Colin Walters
d6aa3b3bdd GTestDBus: Don't call into gvfs
https://bugzilla.gnome.org/show_bug.cgi?id=678808
2012-06-26 12:26:05 -04:00
Dan Winship
55bac5da0a GMainContext: reorganize source list to avoid O(n) behavior
Rather than having a single priority-ordered list of GSources, store a
list of queues of each priority level. This means that adding a source
is now O(n) in the number of unique priority levels currently being
used, rather than O(n) in the total number of sources.

https://bugzilla.gnome.org/show_bug.cgi?id=619329
2012-06-26 08:40:32 -04:00
Dan Winship
aaaaab91de gmain: add GSourceIter
add an explicit iterator for GMainContext sources

https://bugzilla.gnome.org/show_bug.cgi?id=619329
2012-06-26 08:40:31 -04:00
Dan Winship
8e65c30431 gmain: rename some variables for clarity
https://bugzilla.gnome.org/show_bug.cgi?id=619329
2012-06-26 08:40:31 -04:00
Dan Winship
532f463eaf gmain: child sources must always have same priority as parent
A child source does not have a priority of its own; it must have the
same priority as its parent. Enforce this in
g_source_set_priority_unlocked().

https://bugzilla.gnome.org/show_bug.cgi?id=619329
2012-06-26 08:40:31 -04:00
Ryan Lortie
d981d79a42 GSource: initialise ->priv on construct
For efficiency, we waited until setting up child sources to allocate
->priv.  Simplify things a bit by allocating it from the start.

https://bugzilla.gnome.org/show_bug.cgi?id=619329
2012-06-26 08:40:31 -04:00
Dan Winship
56de38da7d tests: add a timing test for adding lots of GSources
https://bugzilla.gnome.org/show_bug.cgi?id=619329
2012-06-26 08:40:31 -04:00
Ryan Lortie
4780ee5d4a glib/: gtk-doc cleanup 2012-06-25 23:23:58 -04:00
Colin Walters
130c249eac Fix previous commit 2012-06-25 19:37:05 -04:00
Colin Walters
b837cdde69 gio/tests/actions: Plug a memory leak 2012-06-25 18:14:10 -04:00
Colin Walters
b65194e8df GIOScheduler: Disconnect from cancellable after job completes
This was causing crashes when a cancellable was canceled after the job
had completed.

https://bugzilla.gnome.org/show_bug.cgi?id=678576
2012-06-25 17:07:16 -04:00
Ryan Lortie
03f2f3b002 *bump* 2012-06-25 16:55:31 -04:00