hal/tools fstab-sync.c,1.35,1.36
Richard Hughes
hughsient at freedesktop.org
Mon Oct 10 08:57:30 PDT 2005
Update of /cvs/hal/hal/tools
In directory gabe:/tmp/cvs-serv4100
Modified Files:
fstab-sync.c
Log Message:
fix fstab parsing for optional fields 5 and 6
Index: fstab-sync.c
===================================================================
RCS file: /cvs/hal/hal/tools/fstab-sync.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- fstab-sync.c 27 Sep 2005 09:42:13 -0000 1.35
+++ fstab-sync.c 10 Oct 2005 15:57:27 -0000 1.36
@@ -574,11 +574,19 @@
/* If it's not before the first field or after the last field
* then we don't want to accept the line ending with whitespace
*/
- if (current_field != FS_TABLE_FIELD_TYPE_WHITE_SPACE
- && (i > length || (line[i] == '\0' && current_field != 0)))
+ if (i > length || (line[i] == '\0' && current_field != 0))
{
- fstab_update_debug (_("%d: Line ended prematurely\n"), pid);
- return FALSE;
+ if (current_field < FS_TABLE_FIELD_TYPE_DUMP_FREQUENCY)
+ {
+ fstab_update_debug (_("%d: Line ended prematurely\n"), pid);
+ return FALSE;
+ }
+ else
+ {
+ /* The last 2 fields are not mandatory, it they are not there,
+ * we are at the end of the line */
+ current_field = FS_TABLE_FIELD_TYPE_WHITE_SPACE;
+ }
}
if (line + i != p)
More information about the hal-commit
mailing list