diff -Naur mc-4.8.13.old/src/filemanager/mountlist.c mc-4.8.13.new/src/filemanager/mountlist.c
old
|
new
|
|
1598 | 1600 | my_statfs (struct my_statfs *myfs_stats, const char *path) |
1599 | 1601 | { |
1600 | 1602 | #ifdef HAVE_INFOMOUNT_LIST |
| 1603 | const char *rpath; |
1601 | 1604 | size_t len = 0; |
1602 | 1605 | struct mount_entry *entry = NULL; |
1603 | 1606 | struct mount_entry *temp = mc_mount_list; |
1604 | 1607 | struct fs_usage fs_use; |
1605 | 1608 | |
| 1609 | if ((rpath = realpath(path, NULL)) == NULL) |
| 1610 | rpath = path; |
| 1611 | |
1606 | 1612 | while (temp) |
1607 | 1613 | { |
1608 | 1614 | size_t i; |
1609 | 1615 | |
1610 | 1616 | i = strlen (temp->me_mountdir); |
1611 | | if (i > len && (strncmp (path, temp->me_mountdir, i) == 0)) |
1612 | | if (!entry || (path[i] == PATH_SEP || path[i] == '\0')) |
| 1617 | if (i > len && (strncmp (rpath, temp->me_mountdir, i) == 0)) |
| 1618 | if (!entry || (rpath[i] == PATH_SEP || rpath[i] == '\0')) |
1613 | 1619 | { |
1614 | 1620 | len = i; |
1615 | 1621 | entry = temp; |
… |
… |
|
1620 | 1626 | if (entry) |
1621 | 1627 | { |
1622 | 1628 | memset (&fs_use, 0, sizeof (struct fs_usage)); |
1623 | | get_fs_usage (entry->me_mountdir, NULL, &fs_use); |
| 1629 | get_fs_usage (rpath, NULL, &fs_use); |
1624 | 1630 | |
1625 | 1631 | myfs_stats->type = entry->me_dev; |
1626 | 1632 | myfs_stats->typename = entry->me_type; |
… |
… |
|
1672 | 1678 | myfs_stats->nfree = 0; |
1673 | 1679 | myfs_stats->nodes = 0; |
1674 | 1680 | } |
| 1681 | |
| 1682 | #ifdef HAVE_INFOMOUNT_LIST |
| 1683 | if (rpath != path) |
| 1684 | free((void *) rpath); |
| 1685 | #endif /* HAVE_INFOMOUNT_LIST */ |
1675 | 1686 | } |
1676 | 1687 | |
1677 | 1688 | /* --------------------------------------------------------------------------------------------- */ |