about summary refs log tree commit diff
path: root/locale/programs/linereader.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-01 19:15:29 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-01 19:15:29 +0000
commit3e07621988521feb5cdd8a99760d8bad1707cb57 (patch)
tree8df7d39fbba8713398c5ca602fe73b0ddc163373 /locale/programs/linereader.c
parentd77cd295eb5bde456868eb5d7c71042edaa88151 (diff)
downloadglibc-3e07621988521feb5cdd8a99760d8bad1707cb57.tar.gz
glibc-3e07621988521feb5cdd8a99760d8bad1707cb57.tar.xz
glibc-3e07621988521feb5cdd8a99760d8bad1707cb57.zip
Update.
2000-10-01  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/BIG5: Add a width table.
	* charmaps/GB18030: Likewise.
	* charmaps/ISO-8859-6: Likewise.
	* charmaps/ISO-8859-8: Likewise.
	* charmaps/TIS-620: Likewise.
Diffstat (limited to 'locale/programs/linereader.c')
-rw-r--r--locale/programs/linereader.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
index 6237094f07..3638ba138a 100644
--- a/locale/programs/linereader.c
+++ b/locale/programs/linereader.c
@@ -47,23 +47,29 @@ struct linereader *
 lr_open (const char *fname, kw_hash_fct_t hf)
 {
   FILE *fp;
-  struct linereader *result;
-  int n;
 
   if (fname == NULL || strcmp (fname, "-") == 0
       || strcmp (fname, "/dev/stdin") == 0)
-    fp = stdin;
+    return lr_create (stdin, "<stdin>", hf);
   else
     {
       fp = fopen (fname, "r");
       if (fp == NULL)
 	return NULL;
+      return lr_create (fp, fname, hf);
     }
+}
+
+struct linereader *
+lr_create (FILE *fp, const char *fname, kw_hash_fct_t hf)
+{
+  struct linereader *result;
+  int n;
 
   result = (struct linereader *) xmalloc (sizeof (*result));
 
   result->fp = fp;
-  result->fname = xstrdup (fname ? : "<stdin>");
+  result->fname = xstrdup (fname);
   result->buf = NULL;
   result->bufsize = 0;
   result->lineno = 1;