From bd4f4a136fc218f0854f5ee5219149ce5b0acdb3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 27 Aug 2013 19:32:02 +0200 Subject: Display translated help pages Use an algorithm similar to gettext's locale resolution to find an appropriate translation to display. Fall back to the English version. Signed-off-by: Lukas Fleischer --- src/io.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index 737be12..b998fc4 100644 --- a/src/io.c +++ b/src/io.c @@ -872,6 +872,13 @@ int io_check_dir(const char *dir) } } +unsigned io_dir_exists(const char *path) +{ + struct stat st; + + return (!stat(path, &st) && S_ISDIR(st.st_mode)); +} + unsigned io_file_exists(const char *file) { FILE *fd; -- cgit v1.2.3-54-g00ecf