/* makedb -- create simple DB database from textual input.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
++cp;
val.data = cp;
- val.size = &line[n] - cp;
+ val.size = (&line[n] - cp) + 1;
/* Store the value. */
status = output->put (output, &key, &val, R_NOOVERWRITE);
gettext ("duplicate key"));
/* This is no real error. Just give a warning. */
status = 0;
+ continue;
}
else
- error (0, errno, gettext ("while writing data base file"));
+ error (0, errno, gettext ("while writing database file"));
- status = status ? EXIT_FAILURE : EXIT_SUCCESS;
+ status = EXIT_FAILURE;
clearerr (input);
break;
if (ferror (input))
{
- error (0, 0, gettext ("problems while reading `%s'"));
+ error (0, 0, gettext ("problems while reading `%s'"), inname);
status = EXIT_FAILURE;
}
no_more = db->seq (db, &key, &val, R_FIRST);
while (!no_more)
{
- printf ("%.*s %.*s\n", (int) key.size, (char *) key.data, (int) val.size,
+ printf ("%.*s %s\n", (int) key.size, (char *) key.data,
(char *) val.data);
no_more = db->seq (db, &key, &val, R_NEXT);