diff options
author | Sebastian Geerken (patch by Johannes Hofmann) <devnull@localhost> | 2012-09-12 13:50:24 +0200 |
---|---|---|
committer | Sebastian Geerken (patch by Johannes Hofmann) <devnull@localhost> | 2012-09-12 13:50:24 +0200 |
commit | eb64db506bb05ac4c1e357341140aa0091846009 (patch) | |
tree | 9e45db3791cdf95eceb5d54afae94dc624ddb3d2 | |
parent | b88370d24633e3d33e935be0942e8242fa50ca51 (diff) |
No hard-coded paths for hyphenation patterns anymore.
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | dw/Makefile.am | 4 | ||||
-rw-r--r-- | dw/hyphenator.cc | 9 |
3 files changed, 9 insertions, 5 deletions
diff --git a/configure.in b/configure.in index 5b7cf273..d2ccc243 100644 --- a/configure.in +++ b/configure.in @@ -10,6 +10,7 @@ AC_CONFIG_SRCDIR([src/dillo.cc]) AC_CONFIG_HEADERS([config.h]) sysconfdir=${sysconfdir}/${PACKAGE} +libdir=${libdir}/${PACKAGE} dnl Options diff --git a/dw/Makefile.am b/dw/Makefile.am index bab63682..cd9fbd11 100644 --- a/dw/Makefile.am +++ b/dw/Makefile.am @@ -1,5 +1,7 @@ AM_CPPFLAGS = \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -DDILLO_LIB='"$(libdir)/"' + noinst_LIBRARIES = \ libDw-core.a \ diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc index 1c64c310..6b9e1c7e 100644 --- a/dw/hyphenator.cc +++ b/dw/hyphenator.cc @@ -4,6 +4,7 @@ #include "../lout/unicode.hh" #include <stdio.h> #include <string.h> +#include <limits.h> #define LEN 1000 @@ -90,10 +91,10 @@ Hyphenator *Hyphenator::getHyphenator (core::Platform *platform, delete pair; else { // TODO Much hard-coded! - char patFile [256]; - sprintf (patFile, "/usr/local/lib/dillo/hyphenation/%s.pat", lang); - char excFile [256]; - sprintf (excFile, "/usr/local/lib/dillo/hyphenation/%s.exc", lang); + char patFile [PATH_MAX]; + snprintf (patFile, sizeof (patFile), "%s/hyphenation/%s.pat", DILLO_LIB, lang); + char excFile [PATH_MAX]; + snprintf (excFile, sizeof(excFile), "%s/hyphenation/%s.exc", DILLO_LIB, lang); //printf ("Loading hyphenation patterns for language '%s' from '%s' and " // "exceptions from '%s' ...\n", lang, patFile, excFile); |