aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
Diffstat (limited to 'dw')
-rw-r--r--dw/Makefile.am4
-rw-r--r--dw/hyphenator.cc9
2 files changed, 8 insertions, 5 deletions
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);