diff options
author | Otavio Salvador <otavio@debian.org> | 2006-11-11 01:32:58 +0000 |
---|---|---|
committer | Otavio Salvador <otavio@debian.org> | 2006-11-11 01:32:58 +0000 |
commit | c4a8b9d94afb889fc90f4a855d55b0a1716c57b2 (patch) | |
tree | bf9d2a41b858ab42d6ecf1b7a818f04d1de008e1 /libparted/filesys.c | |
parent | 65a9b87971a1761274b79aed464ae924d924ce04 (diff) | |
download | parted-c4a8b9d94afb889fc90f4a855d55b0a1716c57b2.tar.gz |
Changes done on darcs repository suitable for 1.8 release:
Fri Nov 10 23:19:15 BRST 2006 Otavio Salvador <otavio@debian.org>
* Code clean-up on registering and unregistering of disks
* libparted/disk.c (ped_register_disk_type, ped_unregister_disk_type):
Clean-up. Patch sent by Debarshi 'Rishi' Ray <debarshi.ray@gmail.com>.
Fri Nov 10 23:14:58 BRST 2006 Otavio Salvador <otavio@debian.org>
* Fix filesystem unregistering
* libparted/filesys.c (ped_file_system_type_unregister): Handle
instances where fs_types == NULL and the given fs_type is not in
the list of registered file-system types. Some code clean-up.
Patch sent by Debarshi 'Rishi' Ray <debarshi.ray@gmail.com>.
git-svn-id: svn://svn.debian.org/svn/parted/upstream/trunk@891 2d424fd7-7fe2-0310-af74-8bc65edeb173
Diffstat (limited to 'libparted/filesys.c')
-rw-r--r-- | libparted/filesys.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libparted/filesys.c b/libparted/filesys.c index cf33f96..04f551c 100644 --- a/libparted/filesys.c +++ b/libparted/filesys.c @@ -62,18 +62,16 @@ ped_file_system_type_unregister (PedFileSystemType* fs_type) PedFileSystemType* walk; PedFileSystemType* last = NULL; + PED_ASSERT (fs_types != NULL, return); PED_ASSERT (fs_type != NULL, return); - for (walk = fs_types; walk != fs_type; walk = walk->next) { - if (!walk) return; - last = walk; - } + for (walk = fs_types; walk && walk != fs_type; last = walk, walk = walk->next); - if (last) { + PED_ASSERT (walk != NULL, return); + if (last) ((struct _PedFileSystemType*) last)->next = fs_type->next; - } else { - fs_types = fs_types->next; - } + else + fs_types = fs_type->next; } /** |