summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in1
-rw-r--r--dw/Makefile.am4
-rw-r--r--dw/hyphenator.cc9
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);