mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 08:02:13 +02:00
Added printtext_string() which works like printtext(), except it prints
text from a string, so that %s, %d, etc. don't work. Changed perl's Irssi::print() use this instead as well as /HELP printer. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1072 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3654085b14
commit
86aa2d514d
6 changed files with 24 additions and 51 deletions
|
|
@ -426,41 +426,6 @@ void printformat_perl(TEXT_DEST_REC *dest, char *format, char **arglist)
|
|||
g_free(module);
|
||||
}
|
||||
|
||||
/* change all %s strings to %%s */
|
||||
char *perl_fix_formats(char *str)
|
||||
{
|
||||
char *ret, *out;
|
||||
|
||||
out = ret = g_malloc(strlen(str)*2+1);
|
||||
while (*str != '\0') {
|
||||
if (*str == '%') {
|
||||
str++;
|
||||
switch (*str) {
|
||||
case 's':
|
||||
case 'd':
|
||||
case 'f':
|
||||
case 'u':
|
||||
case 'l':
|
||||
case '%':
|
||||
*out++ = '%';
|
||||
*out++ = '%';
|
||||
if (*str == '%')
|
||||
str += 2;
|
||||
break;
|
||||
default:
|
||||
*out++ = '%';
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
*out++ = *str++;
|
||||
}
|
||||
*out = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
||||
void perl_command(const char *cmd, SERVER_REC *server, WI_ITEM_REC *item)
|
||||
{
|
||||
const char *cmdchars;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue