return 0;
}
+static grub_err_t ventoy_cmd_strcasebegin(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+ char *c0, *c1;
+
+ (void)ctxt;
+
+ if (argc != 2)
+ {
+ return 1;
+ }
+
+ c0 = args[0];
+ c1 = args[1];
+
+ while (*c0 && *c1)
+ {
+ if ((*c0 != *c1) && (*c0 != grub_toupper(*c1)))
+ {
+ return 1;
+ }
+ c0++;
+ c1++;
+ }
+
+ if (*c1)
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
static grub_err_t ventoy_cmd_incr(grub_extcmd_context_t ctxt, int argc, char **args)
{
long value_long = 0;
{ "vt_mod", ventoy_cmd_mod, 0, NULL, "{Int} {Int} {Var}", "mod integer variable", NULL },
{ "vt_strstr", ventoy_cmd_strstr, 0, NULL, "", "", NULL },
{ "vt_str_begin", ventoy_cmd_strbegin, 0, NULL, "", "", NULL },
+ { "vt_str_casebegin", ventoy_cmd_strcasebegin, 0, NULL, "", "", NULL },
{ "vt_debug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
{ "vtdebug", ventoy_cmd_debug, 0, NULL, "{on|off}", "turn debug on/off", NULL },
{ "vtbreak", ventoy_cmd_break, 0, NULL, "{level}", "set debug break", NULL },
md5sum "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.md5" vtReadChecksum
-
- if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
+
+ if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck MD5 value with .md5 file. [ OK ]"
else
echo -e "\n\nCheck MD5 value with .md5 file. [ FAIL ]"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha1" vtReadChecksum
- if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
+ if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA1 value with .sha1 file. [ OK ]"
else
echo -e "\n\nCheck SHA1 value with .sha1 file. [ FAIL ]"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha256" vtReadChecksum
- if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
+ if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA256 value with .sha256 file. [ OK ]"
else
echo -e "\n\nCheck SHA256 value with .sha256 file. [ FAIL ]"
vt_1st_line "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}.sha512" vtReadChecksum
- if vt_str_begin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
+ if vt_str_casebegin "$vtReadChecksum" "$VT_LAST_CHECK_SUM"; then
echo -e "\n\nCheck SHA512 value with .sha512 file. [ OK ]"
else
echo -e "\n\nCheck SHA512 value with .sha512 file. [ FAIL ]"