mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Clarify checks of input line content returned from quick dialog.
If quick dialog is finished with value other than B_CANCEL, string value of input line isn't NULL. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
79645187c6
commit
36abab7186
@ -113,7 +113,7 @@ mcdiffview_dialog_search (WDiff * dview)
|
||||
|
||||
g_strfreev (list_of_types);
|
||||
|
||||
if ((qd_result == B_CANCEL) || (exp == NULL) || (exp[0] == '\0'))
|
||||
if (qd_result == B_CANCEL || exp[0] == '\0')
|
||||
{
|
||||
g_free (exp);
|
||||
return FALSE;
|
||||
|
@ -200,7 +200,7 @@ edit_options_dialog (WDialog * h)
|
||||
if (!option_cursor_beyond_eol)
|
||||
g_list_foreach (GROUP (h)->widgets, edit_reset_over_col, NULL);
|
||||
|
||||
if (p != NULL)
|
||||
if (*p != '\0')
|
||||
{
|
||||
option_word_wrap_line_length = atoi (p);
|
||||
if (option_word_wrap_line_length <= 0)
|
||||
@ -208,7 +208,7 @@ edit_options_dialog (WDialog * h)
|
||||
g_free (p);
|
||||
}
|
||||
|
||||
if (q != NULL)
|
||||
if (*q != '\0')
|
||||
{
|
||||
option_tab_spacing = atoi (q);
|
||||
if (option_tab_spacing <= 0)
|
||||
|
@ -119,7 +119,7 @@ edit_dialog_search_show (WEdit * edit)
|
||||
|
||||
g_strfreev (list_of_types);
|
||||
|
||||
if ((dialog_result == B_CANCEL) || (search_text == NULL) || (search_text[0] == '\0'))
|
||||
if (dialog_result == B_CANCEL || search_text[0] == '\0')
|
||||
{
|
||||
g_free (search_text);
|
||||
return FALSE;
|
||||
|
@ -612,7 +612,12 @@ configure_box (void)
|
||||
#endif
|
||||
|
||||
if (quick_dialog (&qdlg) == B_ENTER)
|
||||
old_esc_mode_timeout = atoi (time_out_new);
|
||||
{
|
||||
if (time_out_new[0] == '\0')
|
||||
old_esc_mode_timeout = 0;
|
||||
else
|
||||
old_esc_mode_timeout = atoi (time_out_new);
|
||||
}
|
||||
|
||||
g_free (time_out_new);
|
||||
}
|
||||
@ -1177,7 +1182,10 @@ configure_vfs_box (void)
|
||||
if (quick_dialog (&qdlg) != B_CANCEL)
|
||||
{
|
||||
/* cppcheck-suppress uninitvar */
|
||||
vfs_timeout = atoi (ret_timeout);
|
||||
if (ret_timeout[0] == '\0')
|
||||
vfs_timeout = 0;
|
||||
else
|
||||
vfs_timeout = atoi (ret_timeout);
|
||||
g_free (ret_timeout);
|
||||
|
||||
if (vfs_timeout < 0 || vfs_timeout > 10000)
|
||||
@ -1190,7 +1198,10 @@ configure_vfs_box (void)
|
||||
/* cppcheck-suppress uninitvar */
|
||||
ftpfs_proxy_host = ret_ftp_proxy;
|
||||
/* cppcheck-suppress uninitvar */
|
||||
ftpfs_directory_timeout = atoi (ret_directory_timeout);
|
||||
if (ret_directory_timeout[0] == '\0')
|
||||
ftpfs_directory_timeout = 0;
|
||||
else
|
||||
ftpfs_directory_timeout = atoi (ret_directory_timeout);
|
||||
g_free (ret_directory_timeout);
|
||||
#endif
|
||||
}
|
||||
|
@ -1405,7 +1405,7 @@ file_mask_dialog (file_op_context_t * ctx, FileOperation operation, gboolean onl
|
||||
ctx->umask_kill = i2 ^ 0777777;
|
||||
}
|
||||
|
||||
if (dest_dir == NULL || *dest_dir == '\0')
|
||||
if (*dest_dir == '\0')
|
||||
{
|
||||
g_free (def_text_secure);
|
||||
g_free (source_mask);
|
||||
|
@ -2570,7 +2570,7 @@ panel_select_unselect_files_dialog (select_flags_t * flags, const char *title,
|
||||
if (quick_dialog (&qdlg) == B_CANCEL)
|
||||
return NULL;
|
||||
|
||||
if (reg_exp == NULL || *reg_exp == '\0')
|
||||
if (*reg_exp == '\0')
|
||||
{
|
||||
g_free (reg_exp);
|
||||
if (str != NULL)
|
||||
|
@ -110,7 +110,7 @@ mcview_dialog_search (WView * view)
|
||||
|
||||
g_strfreev (list_of_types);
|
||||
|
||||
if ((qd_result == B_CANCEL) || (exp == NULL) || (exp[0] == '\0'))
|
||||
if (qd_result == B_CANCEL || exp[0] == '\0')
|
||||
{
|
||||
g_free (exp);
|
||||
return FALSE;
|
||||
@ -196,7 +196,7 @@ mcview_dialog_goto (WView * view, off_t * offset)
|
||||
*offset = -1;
|
||||
|
||||
/* check input line value */
|
||||
res = (qd_result != B_CANCEL && exp != NULL && exp[0] != '\0');
|
||||
res = (qd_result != B_CANCEL && exp[0] != '\0');
|
||||
if (res)
|
||||
{
|
||||
int base = (current_goto_type == MC_VIEW_GOTO_OFFSET_HEX) ? 16 : 10;
|
||||
|
Loading…
Reference in New Issue
Block a user