mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 17:05:42 +02:00
Added string length limit for setup file options
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2007-08-27
|
||||
ChangeLog - 2007-08-29
|
||||
|
||||
|
||||
Version 0.2.6 (under dev!):
|
||||
* added string length limit for setup file options
|
||||
* fixed bug with flock() when home is on NFS filesystem (bug #20913)
|
||||
* added option to align text of messages (except first lines) (task #7246)
|
||||
* fixed user modes in nicklist when ban and nick mode are received in the
|
||||
|
||||
@@ -180,6 +180,13 @@
|
||||
<entry>20</entry>
|
||||
<entry>Maximale Größe zum Ausrichten von Nicknamen und anderen Nachrichten (sollte >= look_align_size sein)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_text_offset</option></entry>
|
||||
<entry>Ganzzahl</entry>
|
||||
<entry>zwischen -1 und 64</entry>
|
||||
<entry>-1</entry>
|
||||
<entry>Offset for aligning lines of messages (except first lines), default is -1 (align after nick), a null or positive value is offset after beginning of line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>Zeichenfolge</entry>
|
||||
|
||||
+9
-2
@@ -180,6 +180,13 @@
|
||||
<entry>20</entry>
|
||||
<entry>Max size for aligning nick and other messages (should be >= to look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_text_offset</option></entry>
|
||||
<entry>integer</entry>
|
||||
<entry>between -1 and 64</entry>
|
||||
<entry>-1</entry>
|
||||
<entry>Offset for aligning lines of messages (except first lines), default is -1 (align after nick), a null or positive value is offset after beginning of line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>string</entry>
|
||||
@@ -280,8 +287,8 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_read_marker</option></entry>
|
||||
<entry>string</entry>
|
||||
<entry>any string</entry>
|
||||
<entry>char</entry>
|
||||
<entry>any char</entry>
|
||||
<entry>' '</entry>
|
||||
<entry>Use a marker on servers/channels to show first unread line</entry>
|
||||
</row>
|
||||
|
||||
+9
-2
@@ -180,6 +180,13 @@
|
||||
<entry>20</entry>
|
||||
<entry>Taille maximum pour l'alignement des pseudos et autres messages (doit être >= à look_align_size)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_align_text_offset</option></entry>
|
||||
<entry>entier</entry>
|
||||
<entry>entre -1 et 64</entry>
|
||||
<entry>-1</entry>
|
||||
<entry>Décalage pour aligner les lignes des messages (exceptées les premières lignes), par défaut -1 (aligner après le pseudo), une valeur nulle ou positive est le décalage après le début de la ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_nick_completor</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
@@ -280,8 +287,8 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry><option>look_read_marker</option></entry>
|
||||
<entry>chaîne</entry>
|
||||
<entry>toute chaîne</entry>
|
||||
<entry>caractère</entry>
|
||||
<entry>tout caractère</entry>
|
||||
<entry>' '</entry>
|
||||
<entry>Utiliser un marqueur sur les serveurs/canaux pour montrer la première ligne non lue</entry>
|
||||
</row>
|
||||
|
||||
+73
-51
File diff suppressed because it is too large
Load Diff
+13
-1
@@ -3878,7 +3878,19 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
|
||||
weechat_options[last_section][last_option].default_string : _("empty"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
gui_printf (NULL, _(" . type string (any string)\n"));
|
||||
switch (weechat_options[last_section][last_option].max)
|
||||
{
|
||||
case 0:
|
||||
gui_printf (NULL, _(" . type string (any string)\n"));
|
||||
break;
|
||||
case 1:
|
||||
gui_printf (NULL, _(" . type: char (any char)\n"));
|
||||
break;
|
||||
default:
|
||||
gui_printf (NULL, _(" . type string (any string, limit: %d chars)\n"),
|
||||
weechat_options[last_section][last_option].max);
|
||||
break;
|
||||
}
|
||||
gui_printf (NULL, _(" . default value: '%s'\n"),
|
||||
(weechat_options[last_section][last_option].default_string) ?
|
||||
weechat_options[last_section][last_option].default_string : _("empty"));
|
||||
|
||||
+16
-2
@@ -187,8 +187,22 @@ weechat_display_config_options ()
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
weechat_iconv_fprintf (stdout, _(" . type: string\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: any string\n"));
|
||||
switch (weechat_options[i][j].max)
|
||||
{
|
||||
case 0:
|
||||
weechat_iconv_fprintf (stdout, _(" . type: string\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: any string\n"));
|
||||
break;
|
||||
case 1:
|
||||
weechat_iconv_fprintf (stdout, _(" . type: char\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: any char\n"));
|
||||
break;
|
||||
default:
|
||||
weechat_iconv_fprintf (stdout, _(" . type: string\n"));
|
||||
weechat_iconv_fprintf (stdout, _(" . values: any string (limit: %d chars)\n"),
|
||||
weechat_options[i][j].max);
|
||||
break;
|
||||
}
|
||||
weechat_iconv_fprintf (stdout, _(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
|
||||
@@ -290,7 +290,7 @@ t_config_option weechat_options_look[] =
|
||||
"%a, %d %b %Y", NULL, NULL, &cfg_look_day_change_timestamp, config_change_noop },
|
||||
{ "look_read_marker", N_("use a marker on servers/channels to show first unread line"),
|
||||
N_("use a marker on servers/channels to show first unread line"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
OPTION_TYPE_STRING, 0, 1, 0,
|
||||
" ", NULL, NULL, &cfg_look_read_marker, config_change_read_marker },
|
||||
{ "look_input_format", N_("format for input prompt"),
|
||||
N_("format for input prompt ('%c' is replaced by channel or server, "
|
||||
@@ -1430,6 +1430,8 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
return -1;
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
if ((option->max > 0) && (utf8_strlen (value) > option->max))
|
||||
return -1;
|
||||
if (*(option->ptr_string))
|
||||
free (*(option->ptr_string));
|
||||
*(option->ptr_string) = strdup (value);
|
||||
|
||||
Reference in New Issue
Block a user