~ubuntu-branches/ubuntu/wily/grub2/wily-proposed

« back to all changes in this revision

Viewing changes to commands/ls.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Zielcke, Robert Millan, Felix Zielcke
  • Date: 2010-01-26 19:26:25 UTC
  • mfrom: (1.13.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126192625-coq6czap2ofjollf
Tags: 1.98~20100126-1
* New Bazaar snapshot.
  - Includes mipsel-yeeloong port.

[ Robert Millan ]
* config.in: Lower priority of grub2/linux_cmdline_default.

[ Felix Zielcke ]
* Drop `CFLAGS=-O0' workaround on powerpc. Should be fixed correctly now.
* Ship grub-bin2h and grub-script-check in grub-common.
* Terminate NEWS.Debian with a blank line like lintian would suggest
  if that check would be working correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
  int print_files_long (const char *filename,
88
88
                        const struct grub_dirhook_info *info)
89
89
    {
90
 
      char pathname[grub_strlen (dirname) + grub_strlen (filename) + 1];
 
90
      char *pathname;
91
91
 
92
92
      if ((! all) && (filename[0] == '.'))
93
93
        return 0;
97
97
          grub_file_t file;
98
98
 
99
99
          if (dirname[grub_strlen (dirname) - 1] == '/')
100
 
            grub_sprintf (pathname, "%s%s", dirname, filename);
 
100
            pathname = grub_xasprintf ("%s%s", dirname, filename);
101
101
          else
102
 
            grub_sprintf (pathname, "%s/%s", dirname, filename);
 
102
            pathname = grub_xasprintf ("%s/%s", dirname, filename);
 
103
 
 
104
          if (!pathname)
 
105
            return 1;
103
106
 
104
107
          /* XXX: For ext2fs symlinks are detected as files while they
105
108
             should be reported as directories.  */
131
134
                  grub_uint32_t whole, fraction;
132
135
 
133
136
                  whole = grub_divmod64 (fsize, 100, &fraction);
134
 
                  grub_sprintf (buf, "%u.%02u%c", whole, fraction,
135
 
                                grub_human_sizes[units]);
 
137
                  grub_snprintf (buf, sizeof (buf),
 
138
                                 "%u.%02u%c", whole, fraction,
 
139
                                 grub_human_sizes[units]);
136
140
                  grub_printf ("%-12s", buf);
137
141
                }
138
142
              else