We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 550cfa6 commit 803606bCopy full SHA for 803606b
1 file changed
src/woff2_compress.cc
@@ -21,7 +21,14 @@ int main(int argc, char **argv) {
21
}
22
23
string filename(argv[1]);
24
- string outfilename = filename.substr(0, filename.find_last_of(".")) + ".woff2";
+ int lastdot;
25
+ string outfilename;
26
+ if ((lastdot = filename.find_last_of(".")) > filename.find_last_of("/")) {
27
+ outfilename = filename.substr(0, lastdot) + ".woff2";
28
+ } else {
29
+ outfilename = filename + ".woff2";
30
+ }
31
+
32
fprintf(stdout, "Processing %s => %s\n",
33
filename.c_str(), outfilename.c_str());
34
string input = woff2::GetFileContent(filename);
0 commit comments