* grub-core/fs/proc.c: Allow \0 in proc files.
This commit is contained in:
parent
ba82db7a0d
commit
3bbeade41d
5 changed files with 12 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/fs/proc.c: Allow \0 in proc files.
|
||||||
|
|
||||||
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/tests/xnu_uuid_test.c: Fix assert message.
|
* grub-core/tests/xnu_uuid_test.c: Fix assert message.
|
||||||
|
|
|
@ -128,10 +128,11 @@ grub_procfs_open (struct grub_file *file, const char *path)
|
||||||
FOR_LIST_ELEMENTS((entry), (grub_procfs_entries))
|
FOR_LIST_ELEMENTS((entry), (grub_procfs_entries))
|
||||||
if (grub_strcmp (pathptr, entry->name) == 0)
|
if (grub_strcmp (pathptr, entry->name) == 0)
|
||||||
{
|
{
|
||||||
file->data = entry->get_contents ();
|
grub_size_t sz;
|
||||||
|
file->data = entry->get_contents (&sz);
|
||||||
if (!file->data)
|
if (!file->data)
|
||||||
return grub_errno;
|
return grub_errno;
|
||||||
file->size = grub_strlen (file->data);
|
file->size = sz;
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,9 @@ static const char testfile[] =
|
||||||
;
|
;
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_test_txt (void)
|
get_test_txt (grub_size_t *sz)
|
||||||
{
|
{
|
||||||
|
*sz = grub_strlen (testfile);
|
||||||
return grub_strdup (testfile);
|
return grub_strdup (testfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,9 @@ static const char testfile[] =
|
||||||
"timeout=3\n";
|
"timeout=3\n";
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_test_cfg (void)
|
get_test_cfg (grub_size_t *sz)
|
||||||
{
|
{
|
||||||
|
*sz = grub_strlen (testfile);
|
||||||
return grub_strdup (testfile);
|
return grub_strdup (testfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct grub_procfs_entry
|
||||||
struct grub_procfs_entry **prev;
|
struct grub_procfs_entry **prev;
|
||||||
|
|
||||||
const char *name;
|
const char *name;
|
||||||
char * (*get_contents) (void);
|
char * (*get_contents) (grub_size_t *sz);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct grub_procfs_entry *grub_procfs_entries;
|
extern struct grub_procfs_entry *grub_procfs_entries;
|
||||||
|
|
Loading…
Reference in a new issue