+2000-12-31 Bruno Haible <haible@clisp.cons.org>
+
+ * hash.c (insert_entry): Use obstack_copy instead of obstack_copy0.
+
2000-12-30 Bruno Haible <haible@clisp.cons.org>
* system.h (open_po_file): Remove declaration.
/* hash - implement simple hashing table with string based keys.
- Copyright (C) 1994, 1995, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, October 1994.
This program is free software; you can redistribute it and/or modify
else
{
/* An empty bucket has been found. */
- insert_entry_2 (htab, obstack_copy0 (&htab->mem_pool, key, keylen),
+ insert_entry_2 (htab, obstack_copy (&htab->mem_pool, key, keylen),
keylen, hval, idx, data);
return 0;
}
+2000-12-31 Bruno Haible <haible@clisp.cons.org>
+
+ * msgfmt.c (format_directive_message): Pass to insert_entry and
+ find_entry the length including the terminating NUL.
+ * xget-lex.c (xgettext_lex, xgettext_lex_keyword): Likewise.
+
2000-12-31 Bruno Haible <haible@clisp.cons.org>
* msgunfmt.c (read_mo_file): Recognize "/dev/stdin", not "/dev/stdout".
/* Converts Uniforum style .po files to binary .mo files
- Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
This program is free software; you can redistribute it and/or modify
/* We insert the ID/string pair into the hashing table. But we have
to take care for dublicates. */
if (insert_entry (¤t_domain->symbol_tab, msgid_string,
- strlen (msgid_string), entry))
+ strlen (msgid_string) + 1, entry))
{
/* We don't need the just constructed entry. */
free (entry);
translations are different. Tell the user the old
definition for reference. */
find_entry (¤t_domain->symbol_tab, msgid_string,
- strlen (msgid_string), (void **) &entry);
+ strlen (msgid_string) + 1, (void **) &entry);
if (0 != strcmp(msgstr_string, entry->msgstr))
{
po_gram_error_at_line (msgid_pos, _("\
/* GNU gettext - internationalization aids
- Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
default_keywords = 0;
}
- if (find_entry (&keywords, token.string, strlen (token.string),
+ if (find_entry (&keywords, token.string, strlen (token.string) + 1,
&keyword_value)
== 0)
{
sp = strchr (name, ':');
if (sp)
{
+ /* Make a temporary copy of 'name' up to 'sp', because
+ insert_entry() expects a NUL terminated string. */
+ char *name_copy;
+
len = sp - name;
+ name_copy = (char *) alloca (len + 1);
+ memcpy (name_copy, name, len);
+ name_copy[len] = '\0';
+ name = name_copy;
+
argnum = atoi (sp + 1);
}
else
{
len = strlen (name);
+
argnum = 1;
}
- insert_entry (&keywords, name, len, (void *) (long) argnum);
+ insert_entry (&keywords, name, len + 1, (void *) (long) argnum);
}
}