X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fpathlist.c;fp=src%2Fpathlist.c;h=a611bba82884d2fbd39ce40e47ce0ac624a45c10;hp=ada1f302f119b1238a3d6489a1f84f140af43f4c;hb=67a69c52785ae77ae9f86438873e289640eb9562;hpb=dc9b749a16fde09e45f3d3175aec680d38f3d298 diff --git a/src/pathlist.c b/src/pathlist.c index ada1f302..a611bba8 100644 --- a/src/pathlist.c +++ b/src/pathlist.c @@ -128,6 +128,11 @@ parse_path_list_file(tchar *buf, size_t buflen, line_begin = p; line_end = nl; + /* Ignore UTF-8 BOM. */ + if (nl - line_begin >= 3 && (u8)line_begin[0] == 0xef && + (u8)line_begin[1] == 0xbb && (u8)line_begin[2] == 0xbf) + line_begin += 3; + /* Ignore leading whitespace. */ while (line_begin < nl && istspace(*line_begin)) line_begin++;