[frogr] Avoid needing to remove trailing '</rdf:li>' elements
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Avoid needing to remove trailing '</rdf:li>' elements
- Date: Thu, 18 Aug 2011 07:12:27 +0000 (UTC)
commit ec7aabbab044787e558d35113377a343ae2097aa
Author: Mario Sanchez Prada <msanchez igalia com>
Date: Thu Aug 18 08:52:30 2011 +0200
Avoid needing to remove trailing '</rdf:li>' elements
src/frogr-picture-loader.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/frogr-picture-loader.c b/src/frogr-picture-loader.c
index dfe700f..1d0fd9a 100644
--- a/src/frogr-picture-loader.c
+++ b/src/frogr-picture-loader.c
@@ -543,25 +543,18 @@ import_tags_from_xmp_keywords (const char *buffer, size_t len)
{
gchar **keywords = NULL;
gchar *keyword = NULL;
- gchar *kw_end = NULL;
start = &start[8];
end[0] = '\0';
/* Get an array of strings with all the keywords */
- keywords = g_regex_split_simple ("<rdf:li>", start, G_REGEX_DOTALL, 0);
+ keywords = g_regex_split_simple ("<.?rdf:li>", start,
+ G_REGEX_DOTALL | G_REGEX_RAW, 0);
- /* Remove spaces and trailing '</rdf:li>' elements */
+ /* Remove spaces to normalize to flickr tags */
for (i = 0; keywords[i]; i++)
{
keyword = keywords[i];
-
- /* Remove trailing '</rdf:li>' elements */
- kw_end = g_strrstr (keyword, "</rdf:li>");
- if (kw_end)
- kw_end[0] = '\0';
-
- /* Remove spaces to normalize to flickr tags */
keywords[i] = remove_spaces_from_keyword (keyword);
g_free (keyword);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]