Fixed mac quota parsing
authorJamie Cameron <jcameron@webmin.com>
Wed, 27 Feb 2008 05:51:39 +0000 (05:51 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 27 Feb 2008 05:51:39 +0000 (05:51 +0000)
quota/macos-lib.pl

index 6aa59f9..ec46fa7 100644 (file)
@@ -131,7 +131,7 @@ open(QUOTA, "$config{'user_quota_command'} ".quotemeta($_[0])." |");
 $n=0; while(<QUOTA>) {
        chop;
        if (/^(Disk|\s+Filesystem)/) { next; }
-       if (/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+).(.{9})\s+(\S+)\s+(\S+)\s+(\S+)/) {
+       if (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).(.{9})\s+(\S+)\s+(\S+)\s+(\S+)/) {
                $filesys{$n,'filesys'} = $1;
                $filesys{$n,'ublocks'} = int($2);
                $filesys{$n,'sblocks'} = int($3);
@@ -156,7 +156,7 @@ open(QUOTA, "$config{'group_quota_command'} ".quotemeta($_[0])." |");
 $n=0; while(<QUOTA>) {
        chop;
        if (/^(Disk|\s+Filesystem)/) { next; }
-       if (/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+).(.{9})\s+(\S+)\s+(\S+)\s+(\S+)/) {
+       if (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).(.{9})\s+(\S+)\s+(\S+)\s+(\S+)/) {
                $filesys{$n,'filesys'} = $1;
                $filesys{$n,'ublocks'} = int($2);
                $filesys{$n,'sblocks'} = int($3);