Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
1b2483ec
Commit
1b2483ec
authored
May 19, 2024
by
longpanda
Browse files
Skip trash directory by default. (#2831)
parent
c16e7613
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
+9
-0
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
+14
-2
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
+1
-0
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
View file @
1b2483ec
...
@@ -244,6 +244,15 @@ static int ventoy_browser_valid_dirname(const char *name, int len)
...
@@ -244,6 +244,15 @@ static int ventoy_browser_valid_dirname(const char *name, int len)
return
0
;
return
0
;
}
}
if
(
g_filt_trash_dir
)
{
if
(
0
==
grub_strncmp
(
name
,
".trash-"
,
7
)
||
0
==
grub_strcmp
(
name
,
".Trashes"
))
{
return
0
;
}
}
if
(
name
[
0
]
==
'$'
)
if
(
name
[
0
]
==
'$'
)
{
{
if
(
0
==
grub_strncmp
(
name
,
"$RECYCLE.BIN"
,
12
)
||
if
(
0
==
grub_strncmp
(
name
,
"$RECYCLE.BIN"
,
12
)
||
...
...
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
View file @
1b2483ec
...
@@ -65,6 +65,7 @@ int g_initrd_img_count = 0;
...
@@ -65,6 +65,7 @@ int g_initrd_img_count = 0;
int
g_valid_initrd_count
=
0
;
int
g_valid_initrd_count
=
0
;
int
g_default_menu_mode
=
0
;
int
g_default_menu_mode
=
0
;
int
g_filt_dot_underscore_file
=
0
;
int
g_filt_dot_underscore_file
=
0
;
int
g_filt_trash_dir
=
1
;
int
g_sort_case_sensitive
=
0
;
int
g_sort_case_sensitive
=
0
;
int
g_tree_view_menu_style
=
0
;
int
g_tree_view_menu_style
=
0
;
static
grub_file_t
g_old_file
;
static
grub_file_t
g_old_file
;
...
@@ -1900,9 +1901,14 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
...
@@ -1900,9 +1901,14 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh
return
0
;
return
0
;
}
}
if
(
fil
ename
[
0
]
==
'$'
&&
0
==
grub_strncmp
(
filename
,
"$RECYCLE.BIN"
,
12
)
)
if
(
g_
fil
t_trash_dir
)
{
{
return
0
;
if
(
0
==
grub_strncmp
(
filename
,
".trash-"
,
7
)
||
0
==
grub_strcmp
(
filename
,
".Trashes"
)
||
0
==
grub_strncmp
(
filename
,
"$RECYCLE.BIN"
,
12
))
{
return
0
;
}
}
}
if
(
g_plugin_image_list
==
VENTOY_IMG_WHITE_LIST
)
if
(
g_plugin_image_list
==
VENTOY_IMG_WHITE_LIST
)
...
@@ -2831,6 +2837,12 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char
...
@@ -2831,6 +2837,12 @@ static grub_err_t ventoy_cmd_list_img(grub_extcmd_context_t ctxt, int argc, char
{
{
g_filt_dot_underscore_file
=
1
;
g_filt_dot_underscore_file
=
1
;
}
}
strdata
=
ventoy_get_env
(
"VTOY_FILT_TRASH_DIR"
);
if
(
strdata
&&
strdata
[
0
]
==
'0'
&&
strdata
[
1
]
==
0
)
{
g_filt_trash_dir
=
0
;
}
strdata
=
ventoy_get_env
(
"VTOY_SORT_CASE_SENSITIVE"
);
strdata
=
ventoy_get_env
(
"VTOY_SORT_CASE_SENSITIVE"
);
if
(
strdata
&&
strdata
[
0
]
==
'1'
&&
strdata
[
1
]
==
0
)
if
(
strdata
&&
strdata
[
0
]
==
'1'
&&
strdata
[
1
]
==
0
)
...
...
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
View file @
1b2483ec
...
@@ -1298,6 +1298,7 @@ extern int g_tree_view_menu_style;
...
@@ -1298,6 +1298,7 @@ extern int g_tree_view_menu_style;
extern
int
g_sort_case_sensitive
;
extern
int
g_sort_case_sensitive
;
extern
int
g_wimboot_enable
;
extern
int
g_wimboot_enable
;
extern
int
g_filt_dot_underscore_file
;
extern
int
g_filt_dot_underscore_file
;
extern
int
g_filt_trash_dir
;
extern
int
g_vtoy_file_flt
[
VTOY_FILE_FLT_BUTT
];
extern
int
g_vtoy_file_flt
[
VTOY_FILE_FLT_BUTT
];
extern
const
char
*
g_menu_class
[
img_type_max
];
extern
const
char
*
g_menu_class
[
img_type_max
];
extern
char
g_iso_path
[
256
];
extern
char
g_iso_path
[
256
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment