On Fri, Feb 01, 2008 at 11:45:50PM +0100, Robert Millan wrote: > +static void * > +grub_xrealloc (void *ptr, grub_size_t size) > +{ > + void *value = grub_realloc (ptr, size); > + if (value == 0) > + grub_fatal ("Virtual memory exhausted"); > + return value; > +} > + > +static char * > +grub_getline (void) > +{ > + int i; > + char *line; > + > + i = 0; > + line = grub_malloc (1 + i + sizeof('\0')); > + > + while ((line[i - 1] != '\n') && (line[i - 1] != '\r')) > + { > + line[i] = grub_getkey (); > + if (grub_isprint (line[i])) > + grub_putchar (line[i]); > + i++; > + line = grub_xrealloc (line, 1 + i + sizeof('\0')); > + } > + line[i] = '\0'; > + > + return line; > +}
Does it make sense to move any of these two to kernel? Or to normal.mod ? Or maybe just to un-static-ize them and leave them here? -- Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call… if you are unable to speak? (as seen on /.) _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel