diff --git a/include/modval.h b/include/modval.h index df86686..de1dab7 100644 --- a/include/modval.h +++ b/include/modval.h @@ -251,7 +251,6 @@ extern Function_ptr *global; #define put_it (*(void (*)(const char *, ...))global[PUT_IT]) #define bitchsay (*(void (*)(const char *, ...))global[BITCHSAY]) #define yell (*(void (*)(const char *, ...))global[YELL]) -#define add_to_screen (*(void (*)(unsigned char *))global[ADD_TO_SCREEN]) #define add_to_log (*(void (*)(FILE *, time_t, const char *, int ))global[ADD_TO_LOG]) #define bsd_glob (*(int (*)(const char *, int, int (*)(const char *, int), glob_t *))global[BSD_GLOB]) @@ -278,8 +277,8 @@ extern Function_ptr *global; /* screen.c */ #define prepare_display (*(unsigned char **(*)(const unsigned char *, int , int *, int ))global[PREPARE_DISPLAY]) #define add_to_window (*(void (*)(Window *, const unsigned char *))global[ADD_TO_WINDOW]) -#define skip_incoming_mirc (*(unsigned char *(*)(unsigned char *))global[SKIP_INCOMING_MIRC]) -#define add_to_screen (*(void (*)(unsigned char *))global[ADD_TO_SCREEN]) +#define skip_incoming_mirc (*(char *(*)(char *))global[SKIP_INCOMING_MIRC]) +#define add_to_screen (*(void (*)(char *))global[ADD_TO_SCREEN]) #define split_up_line (*(unsigned char **(*)(const unsigned char *, int ))global[SPLIT_UP_LINE]) #define output_line (*(int (*)(const unsigned char *))global[OUTPUT_LINE]) #define output_with_count (*(int (*)(const unsigned char *, int , int ))global[OUTPUT_WITH_COUNT]) diff --git a/include/screen.h b/include/screen.h index cf7d417..c2acd43 100644 --- a/include/screen.h +++ b/include/screen.h @@ -48,7 +48,7 @@ RETSIGTYPE sig_refresh_screen (int); ShrinkInfo resize_display (Window *); void redraw_window (Window *, int); void redraw_all_windows (void); - void BX_add_to_screen (unsigned char *); + void BX_add_to_screen (char *); void do_screens (fd_set *); unsigned char **BX_split_up_line(const unsigned char *, int); void BX_xterm_settitle(void); @@ -65,8 +65,7 @@ Screen * BX_create_new_screen(void); const u_char *BX_skip_ctl_c_seq (const u_char *, int *, int *, int); u_char **BX_prepare_display (const u_char *, int, int *, int); int BX_output_with_count (const unsigned char *, int, int); -unsigned char *BX_skip_incoming_mirc (unsigned char *); -void delchar(unsigned char **text, int cnum); +char *BX_skip_incoming_mirc (char *); /* Dont do any word-wrapping, just truncate each line at its place. */ #define PREPARE_NOWRAP 0x01 diff --git a/source/screen.c b/source/screen.c index a6e47ee..67a8736 100644 --- a/source/screen.c +++ b/source/screen.c @@ -91,20 +91,35 @@ static void put_color (int, int); const u_char *BX_skip_ctl_c_seq (const u_char *start, int *lhs, int *rhs, int proper); +static void delchar(char **text, int cnum) +{ + int i; -unsigned char *BX_skip_incoming_mirc(unsigned char *text) + for (i = 0; i < strlen(*text) - 1; i++) + if (i >= cnum) text[0][i] = text[0][i+1]; + + text[0][i] = 0; +} + +char *BX_skip_incoming_mirc(char *text) { int i, x; - for (i=0;i= cnum) text[0][i] = text[0][i+1]; - - text[0][i] = 0; -} - - /* * add_to_screen: This adds the given null terminated buffer to the screen. * That is, it determines which window the information should go to, which * lastlog the information should be added to, which log the information * should be sent to, etc */ -void BX_add_to_screen(unsigned char *buffer) +void BX_add_to_screen(char *buffer) { -char *out = NULL; - if (!get_int_var(MIRCS_VAR)) - buffer = skip_incoming_mirc(buffer); + char *out; - - out = buffer; + if (!get_int_var(MIRCS_VAR)) + out = skip_incoming_mirc(buffer); + else + out = buffer; if (in_window_command) {