~ubuntu-branches/debian/sid/grub2/sid-200907171846

« back to all changes in this revision

Viewing changes to util/hostfs.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Zielcke, Updated translations
  • Date: 2009-03-17 14:42:10 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090317144210-nbg2w4aitrb24v99
Tags: 1.96+20090317-1
* New SVN snapshot.
  - Fix loading of files with underscore in HFS. (Closes: #516458)

* Update Standards version to 3.8.1. No changes need.

[ Updated translations ]
* Brazilian Portuguese (pt_BR.po) by Flamarion Jorge. (Closes: #519417)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 *  You should have received a copy of the GNU General Public License
17
17
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18
18
 */
19
 
#define _BSD_SOURCE
 
19
 
20
20
#include <grub/fs.h>
21
21
#include <grub/file.h>
22
22
#include <grub/disk.h>
56
56
#endif
57
57
 
58
58
static grub_err_t
59
 
grub_hostfs_dir (grub_device_t device, const char *path,
60
 
                 int (*hook) (const char *filename,
61
 
                              const struct grub_dirhook_info *info))
 
59
grub_hostfs_dir (grub_device_t device, const char *path, 
 
60
                 int (*hook) (const char *filename, int dir))
62
61
{
63
62
  DIR *dir;
64
63
 
74
73
  while (1)
75
74
    {
76
75
      struct dirent *de;
77
 
      struct grub_dirhook_info info;
78
 
      grub_memset (&info, 0, sizeof (info));
79
76
 
80
77
      de = readdir (dir);
81
78
      if (! de)
82
79
        break;
83
80
 
84
81
#ifdef DT_DIR
85
 
      info.dir = (de->d_type == DT_DIR);
 
82
      hook (de->d_name, de->d_type == DT_DIR);
86
83
#else
87
 
      info.dir = !! is_dir (path, de->d_name);
 
84
      hook (de->d_name, is_dir (path, de->d_name));
88
85
#endif
89
 
      hook (de->d_name, &info);
90
 
 
91
86
    }
92
87
 
93
88
  closedir (dir);