1 |
/* minix.c - The minix filesystem, version 1 and 2. */ |
/* minix.c - The minix filesystem, version 1 and 2. */ |
2 |
/* |
/* |
3 |
* GRUB -- GRand Unified Bootloader |
* GRUB -- GRand Unified Bootloader |
4 |
* Copyright (C) 2004 Free Software Foundation, Inc. |
* Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
5 |
* |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
325 |
static grub_err_t |
static grub_err_t |
326 |
grub_minix_find_file (struct grub_minix_data *data, const char *path) |
grub_minix_find_file (struct grub_minix_data *data, const char *path) |
327 |
{ |
{ |
328 |
char fpath[grub_strlen (path)]; |
char fpath[grub_strlen (path) + 1]; |
329 |
char *name = fpath; |
char *name = fpath; |
330 |
char *next; |
char *next; |
331 |
unsigned int pos = 0; |
unsigned int pos = 0; |
332 |
int dirino; |
int dirino; |
333 |
|
|
334 |
grub_strncpy (fpath, path, grub_strlen (path)); |
grub_strcpy (fpath, path); |
335 |
|
|
336 |
/* Skip the first slash. */ |
/* Skip the first slash. */ |
337 |
if (name[0] == '/') |
if (name[0] == '/') |