Commit 88ad2b6d authored by Christophe Mutricy's avatar Christophe Mutricy

Split text and control character to please gettext

parent 3300f2e8
...@@ -253,6 +253,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -253,6 +253,7 @@ static void Run( intf_thread_t *p_intf )
fd = net_Accept( p_intf, p_sys->pi_fd, p_sys->i_clients > 0 ? 0 : -1 ); fd = net_Accept( p_intf, p_sys->pi_fd, p_sys->i_clients > 0 ? 0 : -1 );
if( fd > 0 ) if( fd > 0 )
{ {
char *psz_pwd = strdup( _("Password"));
telnet_client_t *cl; telnet_client_t *cl;
/* to be non blocking */ /* to be non blocking */
...@@ -269,9 +270,10 @@ static void Run( intf_thread_t *p_intf ) ...@@ -269,9 +270,10 @@ static void Run( intf_thread_t *p_intf )
cl->fd = fd; cl->fd = fd;
cl->buffer_write = NULL; cl->buffer_write = NULL;
cl->p_buffer_write = cl->buffer_write; cl->p_buffer_write = cl->buffer_write;
Write_message( cl, NULL, realloc( psz_pwd, strlen(psz_pwd)+ 5 + 1 );
_( "Password: \xff\xfb\x01" ), WRITE_MODE_PWD ); strncat( psz_pwd, ": \xff\xfb\x01", 5);
Write_message( cl, NULL, psz_pwd, WRITE_MODE_PWD );
free( psz_pwd );
TAB_APPEND( p_sys->i_clients, p_sys->clients, cl ); TAB_APPEND( p_sys->i_clients, p_sys->clients, cl );
} }
...@@ -407,8 +409,13 @@ static void Run( intf_thread_t *p_intf ) ...@@ -407,8 +409,13 @@ static void Run( intf_thread_t *p_intf )
*cl->p_buffer_read = '\0'; *cl->p_buffer_read = '\0';
if( strcmp( psz_password, cl->buffer_read ) == 0 ) if( strcmp( psz_password, cl->buffer_read ) == 0 )
{ {
Write_message( cl, NULL, _( "\xff\xfc\x01\r\nWelcome, " char *psz_tmp=strdup( _("Welcome, Master") );
"Master\r\n> " ), WRITE_MODE_CMD ); realloc(psz_tmp, 5 + strlen(psz_tmp) + 4 + 1);
memmove( psz_tmp + 5, psz_tmp, strlen(psz_tmp) + 1 );
memcpy( psz_tmp, "\xff\xfc\x01\r\n",5);
strncat( psz_tmp, "\r\n> ", 4 );
Write_message( cl, NULL, psz_tmp, WRITE_MODE_CMD );
free( psz_tmp);
} }
else else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment