]> wimlib.net Git - wimlib/blobdiff - src/util.c
mount changes (IN PROGRESS)
[wimlib] / src / util.c
index 47b76a828bc534ac8cb91c8d3d825bdfe07bebe3..e14ddd403f64eef883594f7a805ffec19c1e8a15 100644 (file)
@@ -295,8 +295,8 @@ static iconv_t cd_utf8_to_utf16 = (iconv_t)(-1);
 
 /* Converts a string in the UTF-8 encoding to a newly allocated string in the
  * UTF-16 encoding.  */
-char *utf8_to_utf16(const char *utf8_str, size_t utf8_len, 
-                                               size_t *utf16_len_ret)
+char *utf8_to_utf16(const char *utf8_str, size_t utf8_len,
+                   size_t *utf16_len_ret)
 {
        if (cd_utf8_to_utf16 == (iconv_t)(-1)) {
                cd_utf8_to_utf16 = iconv_open("UTF-16LE", "UTF-8");
@@ -428,6 +428,16 @@ const char *path_basename(const char *path)
        return p + 1;
 }
 
+const char *path_stream_name(const char *path)
+{
+       const char *base = path_basename(path);
+       const char *stream_name = strchr(base, ':');
+       if (!stream_name)
+               return NULL;
+       else
+               return stream_name + 1;
+}
+
 /* 
  * Splits a file path into the part before the first '/', or the entire name if
  * there is no '/', and the part after the first sequence of '/' characters.