[Freeassociation-devel] Small fixes

Alvaro Manera alvaro.manera at nokia.com
Mon Jun 29 06:35:54 PDT 2009


Hi,

This is the patch I am going to commit to trunk. It is so simple that I hope 
it is fine with everybody. Some really small fixes when checking for files 
and pointers.

Álvaro

I still have some more patches waiting to be sent to improve the quality of 
libical ;) so more comming...

Index: src/libical/icalmime.c
===================================================================
--- src/libical/icalmime.c      (revision 932)
+++ src/libical/icalmime.c      (working copy)
@@ -345,7 +345,8 @@

        } else if (parts[i].level < last_level){

-           parent = icalcomponent_get_parent(parent);
+           if (parent)
+               parent = icalcomponent_get_parent(parent);
            icalcomponent_add_component(parent,comp);

            last_level = parts[i].level;
Index: src/libical/icalvalue.c
===================================================================
--- src/libical/icalvalue.c     (revision 932)
+++ src/libical/icalvalue.c     (working copy)
@@ -709,6 +709,7 @@
        case ICAL_TEXT_VALUE:
        case ICAL_CALADDRESS_VALUE:
        case ICAL_URI_VALUE:
+       case ICAL_STRING_VALUE:
        case ICAL_QUERY_VALUE:
        {
            if (v->data.v_string != 0) {
Index: src/libicalss/icalfileset.c
===================================================================
--- src/libicalss/icalfileset.c (revision 932)
+++ src/libicalss/icalfileset.c (working copy)
@@ -160,7 +160,7 @@
   fileset = icalfileset_new_reader(path);


-  if (fileset == 0 && icalerrno == ICAL_FILE_ERROR) {
+  if (fileset == 0 || icalerrno == ICAL_FILE_ERROR) {
     /* file does not exist */
     ret = icalcluster_new(path, NULL);
   } else {
Index: src/libicalvcal/icalvcal.c
===================================================================
--- src/libicalvcal/icalvcal.c  (revision 932)
+++ src/libicalvcal/icalvcal.c  (working copy)
@@ -862,7 +862,7 @@

     /* It must be followed by whitespace or the end of the string.
        I'm not sure if anything else is allowed. */
-    if (*s != '\0' && *s != ' ' && *s != '\t') {
+    if (s && *s != '\0' && *s != ' ' && *s != '\t') {
        *error_message = "Invalid Duration";
        return NULL;
     }




More information about the libical-devel mailing list