diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-15 21:07:47 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-15 23:36:36 -0500 |
commit | 4b8268f843b0da1cfe1995d93a0b1f95faccc454 (patch) | |
tree | f7ab0a390cefa0d5fe94e585fbededa6d36c10db /src/journal/catalog.c | |
parent | 2cfbd749af308bdbe56edcfed7f3eea0fc2b93d2 (diff) |
catalog: fix language detection
Detection would fail if language was not specified in the filename
but a dot appeared somewhere higher in the path.
Diffstat (limited to 'src/journal/catalog.c')
-rw-r--r-- | src/journal/catalog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/catalog.c b/src/journal/catalog.c index 2be81aa2f7..e3a3354ab7 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -150,10 +150,10 @@ int catalog_file_lang(const char* filename, char **lang) { return 0; beg = end - 1; - while (beg > filename && *beg != '.') + while (beg > filename && *beg != '.' && *beg != '/' && end - beg < 32) beg --; - if (beg <= filename || end <= beg + 1 || end - beg > 32) + if (*beg != '.' || end <= beg + 1) return 0; _lang = strndup(beg + 1, end - beg - 1); |