]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/infocmp.c
ncurses 5.6 - patch 20080105
[ncurses.git] / progs / infocmp.c
index f463f7e8ec06794d8239038999d4ef8931dc21fa..99db6bbb057f41e1d92a7fa2a3dbd70b115b8a05 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -42,7 +42,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.93 2007/08/12 13:53:44 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.95 2008/01/05 20:53:20 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -1450,7 +1450,7 @@ main(int argc, char *argv[])
        }
     }
 
-    maxterms = (argc + 1 - optind);
+    maxterms = (argc + 2 - optind);
     tfile = typeMalloc(path, maxterms);
     tname = typeCalloc(char *, maxterms);
     entries = typeCalloc(ENTRY, maxterms);
@@ -1492,9 +1492,14 @@ main(int argc, char *argv[])
 
            if (directory) {
 #if USE_DATABASE
-               (void) sprintf(tfile[termcount], "%s/%c/%s",
+#if MIXEDCASE_FILENAMES
+#define LEAF_FMT "%c"
+#else
+#define LEAF_FMT "%02x"
+#endif
+               (void) sprintf(tfile[termcount], "%s/" LEAF_FMT "/%s",
                               directory,
-                              *argv[optind], argv[optind]);
+                              UChar(*argv[optind]), argv[optind]);
                if (itrace)
                    (void) fprintf(stderr,
                                   "%s: reading entry %s from file %s\n",