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 /dw/hyphenator.cc | |
parent | b88370d24633e3d33e935be0942e8242fa50ca51 (diff) |
No hard-coded paths for hyphenation patterns anymore.
Diffstat (limited to 'dw/hyphenator.cc')
-rw-r--r-- | dw/hyphenator.cc | 9 |
1 files changed, 5 insertions, 4 deletions
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); |