mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[cast] (unsigned char) for isspace
This commit is contained in:
parent
828d9e75cf
commit
927fe10c6a
@ -595,9 +595,9 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
|||||||
int cdata_len = strlen(widget_data->cdata);
|
int cdata_len = strlen(widget_data->cdata);
|
||||||
int start = widget_data->info.field.cpos;
|
int start = widget_data->info.field.cpos;
|
||||||
|
|
||||||
while (start > 0 && isspace(widget_data->cdata[start - 1]))
|
while (start > 0 && isspace((unsigned char)widget_data->cdata[start - 1]))
|
||||||
--start;
|
--start;
|
||||||
while (start > 0 && !isspace(widget_data->cdata[start - 1]))
|
while (start > 0 && !isspace((unsigned char)widget_data->cdata[start - 1]))
|
||||||
--start;
|
--start;
|
||||||
|
|
||||||
memmove(widget_data->cdata + start,
|
memmove(widget_data->cdata + start,
|
||||||
@ -610,19 +610,19 @@ kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case ACT_EDIT_MOVE_BACKWARD_WORD:
|
case ACT_EDIT_MOVE_BACKWARD_WORD:
|
||||||
while (widget_data->info.field.cpos > 0 && isspace(widget_data->cdata[widget_data->info.field.cpos - 1]))
|
while (widget_data->info.field.cpos > 0 && isspace((unsigned char)widget_data->cdata[widget_data->info.field.cpos - 1]))
|
||||||
--widget_data->info.field.cpos;
|
--widget_data->info.field.cpos;
|
||||||
while (widget_data->info.field.cpos > 0 && !isspace(widget_data->cdata[widget_data->info.field.cpos - 1]))
|
while (widget_data->info.field.cpos > 0 && !isspace((unsigned char)widget_data->cdata[widget_data->info.field.cpos - 1]))
|
||||||
--widget_data->info.field.cpos;
|
--widget_data->info.field.cpos;
|
||||||
|
|
||||||
goto display_field;
|
goto display_field;
|
||||||
|
|
||||||
case ACT_EDIT_MOVE_FORWARD_WORD:
|
case ACT_EDIT_MOVE_FORWARD_WORD:
|
||||||
while (isspace(widget_data->cdata[widget_data->info.field.cpos]))
|
while (isspace((unsigned char)widget_data->cdata[widget_data->info.field.cpos]))
|
||||||
++widget_data->info.field.cpos;
|
++widget_data->info.field.cpos;
|
||||||
while (widget_data->cdata[widget_data->info.field.cpos] && !isspace(widget_data->cdata[widget_data->info.field.cpos]))
|
while (widget_data->cdata[widget_data->info.field.cpos] && !isspace((unsigned char)widget_data->cdata[widget_data->info.field.cpos]))
|
||||||
++widget_data->info.field.cpos;
|
++widget_data->info.field.cpos;
|
||||||
while (isspace(widget_data->cdata[widget_data->info.field.cpos]))
|
while (isspace((unsigned char)widget_data->cdata[widget_data->info.field.cpos]))
|
||||||
++widget_data->info.field.cpos;
|
++widget_data->info.field.cpos;
|
||||||
|
|
||||||
goto display_field;
|
goto display_field;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "util/color.h"
|
#include "util/color.h"
|
||||||
|
|
||||||
/* FIXME: For UTF-8 strings we need better function than isspace. */
|
/* FIXME: For UTF-8 strings we need better function than isspace. */
|
||||||
#define is_unsplitable(pos) (*(pos) && *(pos) != '\n' && !isspace(*(pos)))
|
#define is_unsplitable(pos) (*(pos) && *(pos) != '\n' && !isspace((unsigned char)*(pos)))
|
||||||
|
|
||||||
void
|
void
|
||||||
add_dlg_text(struct dialog *dlg, char *text,
|
add_dlg_text(struct dialog *dlg, char *text,
|
||||||
@ -175,7 +175,7 @@ split_lines(struct widget_data *widget_data, int max_width)
|
|||||||
int cells = 0;
|
int cells = 0;
|
||||||
|
|
||||||
/* Skip first leading \n or space. */
|
/* Skip first leading \n or space. */
|
||||||
if (isspace(*text)) text++;
|
if (isspace((unsigned char)*text)) text++;
|
||||||
if (!*text) break;
|
if (!*text) break;
|
||||||
|
|
||||||
#ifdef CONFIG_UTF8
|
#ifdef CONFIG_UTF8
|
||||||
@ -229,7 +229,7 @@ dlg_format_text_do(struct dialog_data *dlg_data,
|
|||||||
int cells = 0;
|
int cells = 0;
|
||||||
|
|
||||||
/* Skip first leading \n or space. */
|
/* Skip first leading \n or space. */
|
||||||
if (!firstline && isspace(*text))
|
if (!firstline && isspace((unsigned char)*text))
|
||||||
text++;
|
text++;
|
||||||
else
|
else
|
||||||
firstline = 0;
|
firstline = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user