X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Finspect.c;h=8e56553d9685cc4b394079f1a232b021ae91c1ae;hb=e4996865c3f252d30ad08265674b5df2112ff267;hp=d17496f9419f998530fc90749d42cf2d354360cc;hpb=4440e22f4f7ebffe0728a8c019319d1a2b260cf5;p=libguestfs.git diff --git a/fish/inspect.c b/fish/inspect.c index d17496f..8e56553 100644 --- a/fish/inspect.c +++ b/fish/inspect.c @@ -1,4 +1,4 @@ -/* guestfish - the filesystem interactive shell +/* libguestfs - guestfish and guestmount shared option parsing * Copyright (C) 2010 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify @@ -22,13 +22,35 @@ #include #include -#include "fish.h" +#include "guestfs.h" + +#include "options.h" /* Global that saves the root device between inspect_mount and * print_inspect_prompt. */ static char *root = NULL; +static void +free_strings (char **argv) +{ + int argc; + + for (argc = 0; argv[argc] != NULL; ++argc) + free (argv[argc]); + free (argv); +} + +static int +count_strings (char *const *argv) +{ + int c; + + for (c = 0; argv[c]; ++c) + ; + return c; +} + static int compare_keys_len (const void *p1, const void *p2) { @@ -54,12 +76,14 @@ inspect_mount (void) exit (EXIT_FAILURE); if (roots[0] == NULL) { - fprintf (stderr, _("guestfish: no operating system was found on this disk\n")); + fprintf (stderr, _("%s: no operating system was found on this disk\n"), + program_name); exit (EXIT_FAILURE); } if (roots[1] != NULL) { - fprintf (stderr, _("guestfish: multi-boot operating systems are not supported by the -i option\n")); + fprintf (stderr, _("%s: multi-boot operating systems are not supported by the -i option\n"), + program_name); exit (EXIT_FAILURE); }