summaryrefslogtreecommitdiffstats
path: root/libhb/ports.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-02-22 05:21:04 +0000
committerjstebbins <[email protected]>2014-02-22 05:21:04 +0000
commit993d19bcffe30ae1213ebe040083a86b2c33300f (patch)
tree95a574db516d36610edb1fcbfd160d4e18351150 /libhb/ports.c
parentab50e34327aea45ed0a1b258d07bd269dcc39a9e (diff)
libhb: clean up handling dir directory separator
title->name was getting set to an empty string in some cases due to looking for the wrong directory separator. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6057 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/ports.c')
-rw-r--r--libhb/ports.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libhb/ports.c b/libhb/ports.c
index 6348ceb9d..bb7c235a2 100644
--- a/libhb/ports.c
+++ b/libhb/ports.c
@@ -626,6 +626,27 @@ struct dirent * hb_readdir(HB_DIR *dir)
#endif
}
+void hb_rewinddir(HB_DIR *dir)
+{
+#ifdef SYS_MINGW
+ _wrewinddir(dir->wdir);
+#else
+ return rewinddir(dir);
+#endif
+}
+
+char * hb_strr_dir_sep(const char *path)
+{
+#ifdef SYS_MINGW
+ char *sep = strrchr(path, '/');
+ if (sep == NULL)
+ sep = strrchr(path, '\\');
+ return sep;
+#else
+ return strrchr(path, '/');
+#endif
+}
+
/************************************************************************
* hb_mkdir
************************************************************************