2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
* commands/ls.c (grub_ls_list_files): Free pathname on exit.
This commit is contained in:
parent
468d69fec2
commit
6846cec5f7
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* commands/ls.c (grub_ls_list_files): Free pathname on exit.
|
||||||
|
|
||||||
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* fs/fat.c (grub_fat_iterate_dir): Free unibuf at exit.
|
* fs/fat.c (grub_fat_iterate_dir): Free unibuf at exit.
|
||||||
|
|
|
@ -87,14 +87,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||||
int print_files_long (const char *filename,
|
int print_files_long (const char *filename,
|
||||||
const struct grub_dirhook_info *info)
|
const struct grub_dirhook_info *info)
|
||||||
{
|
{
|
||||||
char *pathname;
|
|
||||||
|
|
||||||
if ((! all) && (filename[0] == '.'))
|
if ((! all) && (filename[0] == '.'))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (! info->dir)
|
if (! info->dir)
|
||||||
{
|
{
|
||||||
grub_file_t file;
|
grub_file_t file;
|
||||||
|
char *pathname;
|
||||||
|
|
||||||
if (dirname[grub_strlen (dirname) - 1] == '/')
|
if (dirname[grub_strlen (dirname) - 1] == '/')
|
||||||
pathname = grub_xasprintf ("%s%s", dirname, filename);
|
pathname = grub_xasprintf ("%s%s", dirname, filename);
|
||||||
|
@ -110,6 +109,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||||
if (! file)
|
if (! file)
|
||||||
{
|
{
|
||||||
grub_errno = 0;
|
grub_errno = 0;
|
||||||
|
grub_free (pathname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||||
|
|
||||||
}
|
}
|
||||||
grub_file_close (file);
|
grub_file_close (file);
|
||||||
|
grub_free (pathname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
grub_printf ("%-12s", "DIR");
|
grub_printf ("%-12s", "DIR");
|
||||||
|
|
Loading…
Add table
Reference in a new issue