summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Hallendal <micke@codefactory.se>2002-05-31 00:31:00 +0000
committerMikael Hallendal <hallski@src.gnome.org>2002-05-31 00:31:00 +0000
commit7b64145656fb3497ba904e960515350d354883f3 (patch)
treea1efc07701d9ee33cd7cc7f1cd47a6ecb2395aa2
parentdfaaba21acde2cf72afb046b509b8175d8c999df (diff)
downloadyelp-7b64145656fb3497ba904e960515350d354883f3.tar.gz
- return the full document if finding the chunk comments fail. This is
2002-05-31 Mikael Hallendal <micke@codefactory.se> * src/yelp-reader.c (reader_get_chunk): - return the full document if finding the chunk comments fail. This is better than just returning NULL. Also silence the warnings for now.
-rw-r--r--ChangeLog5
-rw-r--r--src/yelp-reader.c24
2 files changed, 17 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index b9a0fe61..1336a38c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2002-05-31 Mikael Hallendal <micke@codefactory.se>
+ * src/yelp-reader.c (reader_get_chunk):
+ - return the full document if finding the chunk comments
+ fail. This is better than just returning NULL. Also silence the
+ warnings for now.
+
* Release 0.9.1
* configure.in: bumped version to 0.9.1
diff --git a/src/yelp-reader.c b/src/yelp-reader.c
index 160bfba4..f3675085 100644
--- a/src/yelp-reader.c
+++ b/src/yelp-reader.c
@@ -654,8 +654,8 @@ reader_get_chunk (const gchar *document, const gchar *section)
end = strstr (document, "<!-- End of header -->");
if (!end) {
- g_warning ("Wrong type of document\n");
- return NULL;
+/* g_warning ("Wrong type of document\n"); */
+ return g_strdup (document);
}
header = g_strndup (document, end - document);
@@ -665,20 +665,20 @@ reader_get_chunk (const gchar *document, const gchar *section)
g_free (tag);
if (!start) {
- g_warning ("Document doesn't include section: '%s'", section);
+/* g_warning ("Document doesn't include section: '%s'", section); */
g_free (header);
-
- return NULL;
+
+ return g_strdup (document);
}
end = strstr (start, "<!-- End of chunk -->");
if (!end) {
- g_warning ("Document is doesn't contain end tag for section: %s",
- section);
+/* g_warning ("Document is doesn't contain end tag for section: %s", */
+/* section); */
g_free (header);
-
- return NULL;
+
+ return g_strdup (document);
}
chunk = g_strndup (start, end - start);
@@ -686,11 +686,11 @@ reader_get_chunk (const gchar *document, const gchar *section)
footer = strstr (document, "<!-- Start of footer -->");
if (!footer) {
- g_warning ("Couldn't find footer in document");
+/* g_warning ("Couldn't find footer in document"); */
g_free (header);
g_free (chunk);
-
- return NULL;
+
+ return g_strdup (document);
}
ret_val = g_strconcat (header, chunk, footer, NULL);