Skip to content

Commit 11b1dfb

Browse files
committed
Update examples to use VFS Python Script v1.1
1 parent 6c8b11d commit 11b1dfb

5 files changed

Lines changed: 90 additions & 28 deletions

File tree

examples/C++/virtual_file_system/vfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const VirtualFile virtual_files[] = {
3535
static const int virtual_files_count = sizeof(virtual_files) / sizeof(virtual_files[0]);
3636

3737
static const char* index_files[] = {
38-
"//", "/index.html",
38+
"/", "/index.html",
3939
"/sub/", "/sub/index.html",
4040
NULL
4141
};

examples/C++/virtual_file_system/vfs.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# WebUI Library
2+
# https://webui.me
3+
# https://github.com/webui-dev/webui
4+
# Copyright (c) 2020-2025 Hassan Draga.
5+
# Licensed under MIT License.
6+
# All rights reserved.
7+
# Canada.
8+
#
9+
# WebUI Virtual File System Generator
10+
# v1.1
11+
112
import os
213
import sys
314

@@ -53,7 +64,10 @@ def generate_vfs_header(directory, output_header):
5364

5465
header.write('static const char* index_files[] = {\n')
5566
for dir_path, index_path in index_files.items():
56-
header.write(f' "{dir_path}/", "{index_path}",\n')
67+
if dir_path == "/":
68+
header.write(f' "/", "{index_path}",\n')
69+
else:
70+
header.write(f' "{dir_path}/", "{index_path}",\n')
5771
header.write(' NULL\n')
5872
header.write('};\n\n')
5973

0 commit comments

Comments
 (0)