diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/libmimedir/files/mimedir-duration.diff | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/libmimedir/files/mimedir-duration.diff')
-rw-r--r-- | recipes/libmimedir/files/mimedir-duration.diff | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/recipes/libmimedir/files/mimedir-duration.diff b/recipes/libmimedir/files/mimedir-duration.diff new file mode 100644 index 0000000000..6f991f6aa2 --- /dev/null +++ b/recipes/libmimedir/files/mimedir-duration.diff @@ -0,0 +1,77 @@ +2006-05-10 Neal H. Walfield <neal@gnu.org> + + * mimedir/mimedir-vcomponent.c + (mimedir_vcomponent_get_value_duration): Be more accepting when + parsing the DURATION field. + + +--- libmimedir-gnome-0.3.1/mimedir/mimedir-vcomponent.c.orig 2005-11-03 18:04:21.000000000 +0100 ++++ libmimedir-gnome-0.3.1/mimedir/mimedir-vcomponent.c 2006-05-10 14:17:24.000000000 +0200 +@@ -951,52 +951,33 @@ mimedir_vcomponent_get_value_duration (M + + s++; + +- num = mimedir_vcomponent_parse_number (name, "DURATION", &s, &err); +- if (err) { +- g_propagate_error (error, err); +- return 0; +- } +- if (s[0] != 'H') { +- g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name); +- return 0; +- } +- s++; +- duration += num * SECS_PER_HOUR; +- +- if (s[0]) { ++ while (s[0] != '\0') { + num = mimedir_vcomponent_parse_number (name, "DURATION", &s, &err); + if (err) { + g_propagate_error (error, err); + return 0; + } +- if (s[0] != 'M') { +- g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name); +- return 0; +- } +- s++; +- duration += num * SECS_PER_MINUTE; +- } + +- if (s[0]) { +- num = mimedir_vcomponent_parse_number (name, "DURATION", &s, &err); +- if (err) { +- g_propagate_error (error, err); +- return 0; +- } +- if (s[0] != 'S') { ++ switch (s[0]) { ++ case 'H': ++ s++; ++ duration += num * SECS_PER_HOUR; ++ break; ++ case 'M': ++ s++; ++ duration += num * SECS_PER_MINUTE; ++ break; ++ case 'S': ++ s++; ++ duration += num; ++ break; ++ default: + g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name); + return 0; + } +- s++; +- duration += num; + } + } + +- if (s[0] != '\0') { +- g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name); +- return 0; +- } +- + return neg ? -duration : duration; + } + |