1
0
mirror of https://github.com/MidnightCommander/mc synced 2025-01-12 22:39:18 +03:00

(file_mask_dialog): refactoring: get rid of goto.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2022-02-19 18:34:36 +03:00
parent 2087ede32d
commit f0924b954d

View File

@ -1371,49 +1371,49 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation, gboolean onl
quick_widgets, NULL, NULL
};
ask_file_mask:
val = quick_dialog_skip (&qdlg, 4);
if (val == B_CANCEL)
while (TRUE)
{
g_free (def_text_secure);
return NULL;
}
val = quick_dialog_skip (&qdlg, 4);
ctx->stat_func = ctx->follow_links ? mc_stat : mc_lstat;
if (val == B_CANCEL)
{
g_free (def_text_secure);
return NULL;
}
if (ctx->op_preserve)
{
ctx->preserve = TRUE;
ctx->umask_kill = 0777777;
ctx->preserve_uidgid = (geteuid () == 0);
}
else
{
mode_t i2;
ctx->stat_func = ctx->follow_links ? mc_stat : mc_lstat;
ctx->preserve = ctx->preserve_uidgid = FALSE;
i2 = umask (0);
umask (i2);
ctx->umask_kill = i2 ^ 0777777;
}
if (ctx->op_preserve)
{
ctx->preserve = TRUE;
ctx->umask_kill = 0777777;
ctx->preserve_uidgid = (geteuid () == 0);
}
else
{
mode_t i2;
if ((dest_dir == NULL) || (*dest_dir == '\0'))
{
g_free (def_text_secure);
g_free (source_mask);
g_free (dest_dir);
return NULL;
}
ctx->preserve = ctx->preserve_uidgid = FALSE;
i2 = umask (0);
umask (i2);
ctx->umask_kill = i2 ^ 0777777;
}
ctx->search_handle = mc_search_new (source_mask, NULL);
if (dest_dir == NULL || *dest_dir == '\0')
{
g_free (def_text_secure);
g_free (source_mask);
g_free (dest_dir);
return NULL;
}
ctx->search_handle = mc_search_new (source_mask, NULL);
if (ctx->search_handle != NULL)
break;
if (ctx->search_handle == NULL)
{
message (D_ERROR, MSG_ERROR, _("Invalid source pattern '%s'"), source_mask);
MC_PTR_FREE (dest_dir);
MC_PTR_FREE (source_mask);
goto ask_file_mask;
}
g_free (def_text_secure);