Avoid redudant tests (#521851) Patch from Josselin Mouette

2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * gunixmounts.c:
        (guess_mount_type):
	Avoid redudant tests (#521851)
	Patch from Josselin Mouette


svn path=/trunk/; revision=6710
This commit is contained in:
Alexander Larsson 2008-03-14 11:15:49 +00:00 committed by Alexander Larsson
parent 6088f22d26
commit 240ba02786
2 changed files with 9 additions and 19 deletions

View File

@ -1,3 +1,10 @@
2008-03-14 Alexander Larsson <alexl@redhat.com>
* gunixmounts.c:
(guess_mount_type):
Avoid redudant tests (#521851)
Patch from Josselin Mouette
2008-03-14 Alexander Larsson <alexl@redhat.com>
* gfilemonitor.c:

View File

@ -1598,27 +1598,10 @@ guess_mount_type (const char *mount_path,
{
basename = g_path_get_basename (mount_path);
if (g_str_has_prefix (basename, "cdrom") ||
if (g_str_has_prefix (basename, "cdr") ||
g_str_has_prefix (basename, "cdwriter") ||
g_str_has_prefix (basename, "burn") ||
g_str_has_prefix (basename, "cdr") ||
g_str_has_prefix (basename, "cdrw") ||
g_str_has_prefix (basename, "dvdrom") ||
g_str_has_prefix (basename, "dvdram") ||
g_str_has_prefix (basename, "dvdr") ||
g_str_has_prefix (basename, "dvdrw") ||
g_str_has_prefix (basename, "cdrom_dvdrom") ||
g_str_has_prefix (basename, "cdrom_dvdram") ||
g_str_has_prefix (basename, "cdrom_dvdr") ||
g_str_has_prefix (basename, "cdrom_dvdrw") ||
g_str_has_prefix (basename, "cdr_dvdrom") ||
g_str_has_prefix (basename, "cdr_dvdram") ||
g_str_has_prefix (basename, "cdr_dvdr") ||
g_str_has_prefix (basename, "cdr_dvdrw") ||
g_str_has_prefix (basename, "cdrw_dvdrom") ||
g_str_has_prefix (basename, "cdrw_dvdram") ||
g_str_has_prefix (basename, "cdrw_dvdr") ||
g_str_has_prefix (basename, "cdrw_dvdrw"))
g_str_has_prefix (basename, "dvdr"))
type = G_UNIX_MOUNT_TYPE_CDROM;
else if (g_str_has_prefix (basename, "floppy"))
type = G_UNIX_MOUNT_TYPE_FLOPPY;