pygobject r734 - in trunk: . gio
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: pygobject r734 - in trunk: . gio
- Date: Sat, 19 Jan 2008 15:29:42 +0000 (GMT)
Author: johan
Date: Sat Jan 19 15:29:42 2008
New Revision: 734
URL: http://svn.gnome.org/viewvc/pygobject?rev=734&view=rev
Log:
2008-01-19  Johan Dahlin  <johan gnome org>
	* gio/gio.override: Fix a silly bug so it possible to read files 
	larger than 8192 bytes.
Modified:
   trunk/ChangeLog
   trunk/gio/gio.override
Modified: trunk/gio/gio.override
==============================================================================
--- trunk/gio/gio.override	(original)
+++ trunk/gio/gio.override	Sat Jan 19 15:29:42 2008
@@ -5,6 +5,8 @@
 #include <pygobject.h>
 #include <gio/gio.h>
 
+#DEFINE BUFSIZE
+
 %%
 modulename gio
 %%
@@ -86,21 +88,20 @@
   PyObject *v;
   
   GCancellable *cancellable;
-  gsize count = -1; 
+  long count = -1; 
   GError *error = NULL;
   size_t bytesread, buffersize, chunksize;
   
   if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-				   "|iO!:GInputStream.skip",
+				   "|iO!:InputStream.read",
 				   kwlist, &count,
 				   &PyGCancellable_Type, &pycancellable))
         return NULL;
 
-  buffersize = 8192;
+  buffersize = BUFSIZE;
 
   cancellable = pycancellable ? G_CANCELLABLE(pycancellable->obj) : NULL;
 
-
   v = PyString_FromStringAndSize((char *)NULL, buffersize);
   if (v == NULL)
     return NULL;
@@ -134,6 +135,7 @@
 
       if (count < 0)
 	{
+	  buffersize += BUFSIZE;
 	  if (_PyString_Resize(&v, buffersize) < 0)
 	    return NULL;
 	}
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]