simplified last example
This commit is contained in:
parent
294c7f8198
commit
e4f555a0ca
1 changed files with 2 additions and 5 deletions
7
main.cpp
7
main.cpp
|
|
@ -94,15 +94,12 @@ int main() {
|
|||
filename+=path;
|
||||
ifstream ifs;
|
||||
//A simple platform-independent file-or-directory check do not exist, but this works in most of the cases:
|
||||
if(filename.find('.')!=string::npos) {
|
||||
ifs.open(filename, ifstream::in);
|
||||
}
|
||||
else {
|
||||
if(filename.find('.')==string::npos) {
|
||||
if(filename[filename.length()-1]!='/')
|
||||
filename+='/';
|
||||
filename+="index.html";
|
||||
ifs.open(filename, ifstream::in);
|
||||
}
|
||||
ifs.open(filename, ifstream::in);
|
||||
|
||||
if(ifs) {
|
||||
ifs.seekg(0, ios::end);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue