summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Baergen <joshuabaergen@gentoo.org>2005-12-14 17:41:47 +0000
committerJoshua Baergen <joshuabaergen@gentoo.org>2005-12-14 17:41:47 +0000
commit2f543dac5f7727c842b97ca879557d6d619d915d (patch)
treef229eef14c5d868e7d6823d1dd9d419675033b8b /x11-apps/ttmkfdir/files/ttmkfdir-3.0.9-encoding.patch
parentAdd ~sparc keyword --- Bug 115539. (diff)
downloadgentoo-2-2f543dac5f7727c842b97ca879557d6d619d915d.tar.gz
gentoo-2-2f543dac5f7727c842b97ca879557d6d619d915d.tar.bz2
gentoo-2-2f543dac5f7727c842b97ca879557d6d619d915d.zip
Move from x11-misc to x11-apps.
(Portage version: 2.0.53)
Diffstat (limited to 'x11-apps/ttmkfdir/files/ttmkfdir-3.0.9-encoding.patch')
-rw-r--r--x11-apps/ttmkfdir/files/ttmkfdir-3.0.9-encoding.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/x11-apps/ttmkfdir/files/ttmkfdir-3.0.9-encoding.patch b/x11-apps/ttmkfdir/files/ttmkfdir-3.0.9-encoding.patch
new file mode 100644
index 000000000000..30f0170f4b3b
--- /dev/null
+++ b/x11-apps/ttmkfdir/files/ttmkfdir-3.0.9-encoding.patch
@@ -0,0 +1,73 @@
+diff -urN ttmkfdir-3.0.9.orig/directory.cpp ttmkfdir-3.0.9/directory.cpp
+--- ttmkfdir-3.0.9.orig/directory.cpp 2002-12-09 00:29:11.000000000 -0800
++++ ttmkfdir-3.0.9/directory.cpp 2004-09-02 23:42:16.000000000 -0700
+@@ -9,10 +9,12 @@
+ {
+ }
+
+-void
++int
+ directory::scan (const std::string &dir)
+ {
+ DIR *ttfdir = opendir(dir.c_str ());
++ if(!ttfdir)
++ return -1;
+
+ this->clear ();
+ dirpath = dir;
+@@ -26,6 +28,7 @@
+ }
+
+ closedir (ttfdir);
++ return 0;
+ }
+
+ bool
+diff -urN ttmkfdir-3.0.9.orig/directory.h ttmkfdir-3.0.9/directory.h
+--- ttmkfdir-3.0.9.orig/directory.h 2002-12-09 00:29:11.000000000 -0800
++++ ttmkfdir-3.0.9/directory.h 2004-09-02 23:42:16.000000000 -0700
+@@ -11,7 +11,7 @@
+ if (path != "") scan (path);
+ };
+ virtual ~directory (void);
+- void scan (const std::string &path = ".");
++ int scan (const std::string &path = ".");
+ virtual bool select (const char *name) const;
+ const std::string &path (void) const {
+ return dirpath;
+diff -urN ttmkfdir-3.0.9.orig/encoding.l ttmkfdir-3.0.9/encoding.l
+--- ttmkfdir-3.0.9.orig/encoding.l 2003-01-07 21:25:25.000000000 -0800
++++ ttmkfdir-3.0.9/encoding.l 2004-09-02 23:42:51.000000000 -0700
+@@ -108,7 +108,7 @@
+ }
+
+ /* now mark all the unassigned codes */
+- for (long i = i1; i <= i2; i++) {
++ for (long i = i1; i <= i2 && i < cur_enc->size; i++) {
+ (*cur_map)[i] = -1;
+ }
+ }
+@@ -140,7 +140,7 @@
+ break;
+ }
+
+- for (i = start_range; i <= end_range; i++, target++) {
++ for (i = start_range; i <= end_range && i < cur_enc->size; i++, target++) {
+ (*cur_map)[i] = target;
+ }
+ cur_enc->enc_size = cur_enc->enc_size + end_range - start_range + 1;
+diff -urN ttmkfdir-3.0.9.orig/ttmkfdir.cpp ttmkfdir-3.0.9/ttmkfdir.cpp
+--- ttmkfdir-3.0.9.orig/ttmkfdir.cpp 2003-01-19 15:33:11.000000000 -0800
++++ ttmkfdir-3.0.9/ttmkfdir.cpp 2004-09-02 23:42:16.000000000 -0700
+@@ -60,7 +60,10 @@
+ return 0;
+ }
+
+- dir::instance()->scan (cmdline::instance()->option ("font-dir"));
++ if(dir::instance()->scan (cmdline::instance()->option ("font-dir")) == -1) {
++ printf("No such directory...\n");
++ return -1;
++ }
+
+ for (directory::iterator i = dir::instance()->begin (); i != dir::instance()->end(); i++) {
+ const ttf::Face face (dir::instance()->path() + '/' + *i);