All pastes #757780 Raw Edit

Meins

public text v1 · immutable
·published 2007-11-01 16:30 UTC
rendered paste body
Index: glocalfileinfo.c
===================================================================
--- glocalfileinfo.c    (Revision 680)
+++ glocalfileinfo.c    (Arbeitskopie)
@@ -617,10 +617,17 @@
   gboolean is_user;
   char *a;
 
+  if (attr_value == NULL)
+    {
+      g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                   _("Attribute value must be non-NULL"));
+      return FALSE;
+    }
+
   if (attr_value->type != G_FILE_ATTRIBUTE_TYPE_STRING)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                  _("Invalid attribute type (string expected)"));
+                   _("Invalid attribute type (string expected)"));
       return FALSE;
     }
 
Index: gfile.c
===================================================================
--- gfile.c     (Revision 680)
+++ gfile.c     (Arbeitskopie)
@@ -1022,7 +1105,7 @@
          break;
        }
 
-      if (n_read == 0)
+      if (n_read == 0 || !res)
        break;
 
       current_size += n_read;
@@ -1038,8 +1121,11 @@
            }
 
          p += n_written;
-         n_read -= n_read;
+         n_read -= n_written;
        }
+
+      if (!res)
+        break;