From 59e156ea3a559e73e766046726685821e6dc5065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Tue, 17 Apr 2012 19:18:44 +0400 Subject: [PATCH] ges-launch: use GRegex instead of POSIX regex http://bugzilla-attachments.gnome.org/attachment.cgi?id=212249 --- tools/ges-launch.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/ges-launch.c b/tools/ges-launch.c index 1b3018a4a6..769809cb46 100644 --- a/tools/ges-launch.c +++ b/tools/ges-launch.c @@ -28,7 +28,6 @@ #include #include #include -#include /* GLOBAL VARIABLE */ static guint repeat = 0; @@ -93,16 +92,15 @@ check_path (char *path) static gboolean check_time (char *time) { - static regex_t re; - static gboolean compiled = FALSE; + static GRegex *re = NULL; - if (!compiled) { - compiled = TRUE; - if (regcomp (&re, "^[0-9]+(.[0-9]+)?$", REG_EXTENDED | REG_NOSUB)) + if (!re) { + if (NULL == (re = g_regex_new ("^[0-9]+(.[0-9]+)?$", G_REGEX_EXTENDED, 0, + NULL))) return FALSE; } - if (!regexec (&re, time, (size_t) 0, NULL, 0)) + if (g_regex_match (re, time, 0, NULL)) return TRUE; return FALSE; }