Index: glib/gchecksum.c
===================================================================
--- glib/gchecksum.c	(revision 6334)
+++ glib/gchecksum.c	(working copy)
@@ -1187,7 +1187,7 @@
  * g_checksum_update:
  * @checksum: a #GChecksum
  * @data: buffer used to compute the checksum
- * @length: size of the buffer
+ * @length: size of the buffer, or -1 if it is a null-terminated string.
  *
  * Feeds @data into an existing #GChecksum. The checksum must still be
  * open, that is g_checksum_get_string() or g_checksum_get_digest() must
@@ -1203,6 +1203,9 @@
   g_return_if_fail (checksum != NULL);
   g_return_if_fail (data != NULL);
 
+  if (length < 0)
+    length = strlen (data);
+
   if (checksum->digest_str)
     {
       g_warning ("The checksum `%s' has been closed and cannot be updated "
@@ -1387,7 +1390,7 @@
  * g_compute_checksum_for_string:
  * @checksum_type: a #GChecksumType
  * @str: the string to compute the checksum of
- * @length: the length of the string, or -1
+ * @length: the length of the string, or -1 if the string is null-terminated.
  *
  * Computes the checksum of a string.
  *
Index: gio/ChangeLog
===================================================================
--- gio/ChangeLog	(revision 6334)
+++ gio/ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2008-01-20  Murray Cumming,,,  <murrayc@murrayc.com>
+
+	reviewed by: <delete if not using a buddy>
+
+	* gfile.c:
+
 2008-01-18  Murray Cumming  <murrayc@murrayc.com>
 
 	* gmount.c: (g_mount_remount): documentation: 
Index: gio/gfile.c
===================================================================
--- gio/gfile.c	(revision 6334)
+++ gio/gfile.c	(working copy)
@@ -837,13 +837,13 @@
  * general approach to handling that is to not check, but just do the
  * operation and handle the errors as they come.
  *
- * As an example of race-free checking. Take the case of reading a file, and
- * if it doesn't exist, create it. There are two racy versions: read it, and
+ * As an example of race-free checking, take the case of reading a file, and
+ * if it doesn't exist, creating it. There are two racy versions: read it, and
  * on error create it; and: check if it exists, if not create it. These
  * can both result in two processes creating the file (with perhaps a partially
  * written file as the result). The correct approach is to always try to create
  * the file with g_file_create() which will either atomically create the file
- * or fail with an G_IO_ERROR_EXISTS error.
+ * or fail with a G_IO_ERROR_EXISTS error.
  *
  * However, in many cases an existance check is useful in a user
  * interface, for instance to make a menu item sensitive/insensitive, so that
@@ -880,8 +880,8 @@
  * @error: a #GError.
  *
  * Gets the requested information about specified @file. The result
- * is a #GFileInfo objects that contains key-value attributes (like type or size
- * for the file.
+ * is a #GFileInfo object that contains key-value attributes (such as 
+ * the type or size of the file).
  *
  * The @attribute value is a string that specifies the file attributes that
  * should be gathered. It is not an error if it's not possible to read a particular
@@ -899,7 +899,7 @@
  * symlink is returned, rather than information about the symlink itself.
  * However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the
  * information about the symlink itself will be returned. Also, for symlinks
- * that points to non-existing files the information about the symlink itself
+ * that point to non-existing files the information about the symlink itself
  * will be returned.
  *
  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
@@ -946,7 +946,7 @@
  * @user_data: the data to pass to callback function
  * 
  * Asynchronously gets the requested information about specified @file. The result
- * is a #GFileInfo objects that contains key-value attributes (such as type or size
+ * is a #GFileInfo object that contains key-value attributes (such as type or size
  * for the file).
  * 
  * For more details, see g_file_query_info() which is
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 6334)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2008-01-20  Murray Cumming  <murrayc@murrayc.com>
+
+	* glib/gchecksum.c: (g_checksum_update): Accept -1 for the data 
+	length if the data is a null-terminated string. Bug #510855.
+
 2008-01-18 16:51:23  Tim Janik  <timj@imendio.com>
 
 	* glib/gutils.h: don't define __GNUC_PREREQ which is not in the glib
