[Pkg-utopia-commits] r143 - packages/hal/trunk/debian/patches

Sjoerd Simons sjoerd@haydn.debian.org
Sun, 19 Dec 2004 09:34:12 -0700


Author: sjoerd
Date: 2004-12-19 09:31:45 -0700 (Sun, 19 Dec 2004)
New Revision: 143

Modified:
   packages/hal/trunk/debian/patches/special_mtab_chars.patch
Log:
* Use a glib function to go from special chars in octal enconding back to
  normal.. 


Modified: packages/hal/trunk/debian/patches/special_mtab_chars.patch
===================================================================
--- packages/hal/trunk/debian/patches/special_mtab_chars.patch	2004-12-18 21:50:23 UTC (rev 142)
+++ packages/hal/trunk/debian/patches/special_mtab_chars.patch	2004-12-19 16:31:45 UTC (rev 143)
@@ -4,30 +4,17 @@
 retrieving revision 1.86.2.4
 diff -u -r1.86.2.4 block_class_device.c
 --- hald/linux/block_class_device.c	9 Dec 2004 03:15:22 -0000	1.86.2.4
-+++ hald/linux/block_class_device.c	18 Dec 2004 21:04:44 -0000
-@@ -1922,10 +1922,23 @@
- 
- 	mount_points[num_mount_points].major = major;
++++ hald/linux/block_class_device.c	19 Dec 2004 16:10:21 -0000
+@@ -1924,8 +1924,10 @@
  	mount_points[num_mount_points].minor = minor;
-+  for (i = 0, p = mount_point; i < MOUNT_POINT_STRING_SIZE && *p != '\0'; i++) {
-+    char tmp;
-+    if (*p == '\\') {
-+      /* the kernel escapes various symbols into octal form, including \ ! */
-+      p++;
-+      tmp = 0;
-+      if (*p != '\0') tmp |= ((g_ascii_digit_value(*p++) << 6));
-+      if (*p != '\0') tmp |= ((g_ascii_digit_value(*p++) << 3) & 070);
-+      if (*p != '\0') tmp |= ((g_ascii_digit_value(*p++)) & 07);
-+    } else {
-+      tmp = *p++;
-+    }
-+    mount_points[num_mount_points].mount_point[i] = tmp;
-+  }
-+  mount_points[num_mount_points].mount_point[i] = '\0';
  	strncpy (mount_points[num_mount_points].device, device,
  		 MOUNT_POINT_STRING_SIZE);
 -	strncpy (mount_points[num_mount_points].mount_point, mount_point,
 -		 MOUNT_POINT_STRING_SIZE);
++	p = g_strcompress(mount_point);
++	strncpy (mount_points[num_mount_points].mount_point, p, 
++		MOUNT_POINT_STRING_SIZE);
++	g_free(p);
  	strncpy (mount_points[num_mount_points].fs_type, fs_type,
  		 MOUNT_POINT_STRING_SIZE);