+2002-05-29 Bruno Haible <bruno@clisp.org>
+
+ * dir-list.h (dir_list_save_reset, dir_list_restore): New declarations.
+ * dir-list.c (dir_list_save_reset, dir_list_restore): New functions.
+ * xgettext.c (main): Temporarily reset the dir_list while opening
+ reading the contents of the output file.
+ Reported by Mark Eichin <eichin@thok.org>.
+
2002-05-22 Bruno Haible <bruno@clisp.org>
* msgl-iconv.h (iconv_message_list): Add from_filename argument.
/* GNU gettext - internationalization aids
- Copyright (C) 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
return NULL;
return directory->item[n];
}
+
+
+/* Return the current list of directories, for later use with dir_list_restore.
+ Reset the list to empty. */
+void *
+dir_list_save_reset ()
+{
+ void *saved_value = directory;
+
+ directory = NULL;
+ return saved_value;
+}
+
+
+/* Restore a previously saved list of directories. */
+void
+dir_list_restore (saved_value)
+ void *saved_value;
+{
+ /* Don't free the contained strings, because they may have been returned
+ by dir_list_nth and may still be in use. */
+ if (directory != NULL)
+ {
+ if (directory->item != NULL)
+ free (directory->item);
+ free (directory);
+ }
+
+ directory = saved_value;
+}
/* GNU gettext - internationalization aids
- Copyright (C) 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
/* Return the nth directory, or NULL of n is out of range. */
extern const char *dir_list_nth PARAMS ((int n));
+/* Return the current list of directories, for later use with dir_list_restore.
+ Reset the list to empty. */
+extern void *dir_list_save_reset PARAMS ((void));
+
+/* Restore a previously saved list of directories. */
+extern void dir_list_restore PARAMS ((void *saved_value));
+
#endif /* _DIR_LIST_H */
/* Read in the old messages, so that we can add to them. */
if (join_existing)
- extract_from_file (file_name, extract_po, mdlp);
+ {
+ /* Temporarily reset the directory list to empty, because file_name
+ is an output file and therefore should not be searched for. */
+ void *saved_directory_list = dir_list_save_reset ();
+
+ extract_from_file (file_name, extract_po, mdlp);
+
+ dir_list_restore (saved_directory_list);
+ }
/* Process all input files. */
for (cnt = 0; cnt < file_list->nitems; ++cnt)