/[weechat]/weechat/src/common/command.c
ViewVC logotype

Diff of /weechat/src/common/command.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.77 by flashcode, Fri Nov 4 22:53:10 2005 UTC revision 1.78 by flashcode, Sat Nov 5 11:34:53 2005 UTC
# Line 481  int Line 481  int
481  exec_weechat_command (t_irc_server *server, char *string)  exec_weechat_command (t_irc_server *server, char *string)
482  {  {
483      int i, argc, return_code, length1, length2;      int i, argc, return_code, length1, length2;
484      char *command, *pos, *ptr_args, **argv, *alias_command;      char *command, *pos, *ptr_args, *ptr_args_color, **argv, *alias_command;
485      t_weechat_alias *ptr_alias;      t_weechat_alias *ptr_alias;
486    
487      if ((!string) || (!string[0]) || (string[0] != '/'))      if ((!string) || (!string[0]) || (string[0] != '/'))
# Line 512  exec_weechat_command (t_irc_server *serv Line 512  exec_weechat_command (t_irc_server *serv
512              ptr_args = NULL;              ptr_args = NULL;
513      }      }
514            
515        ptr_args_color = NULL;
516        
517        if (ptr_args && (cfg_irc_colors_send))
518        {
519            ptr_args_color = (char *)gui_color_encode ((unsigned char *)ptr_args);
520            if (ptr_args_color)
521                ptr_args = ptr_args_color;
522        }
523        
524  #ifdef PLUGINS  #ifdef PLUGINS
525      if (!plugin_cmd_handler_exec ((server) ? server->name : "", command + 1, ptr_args))      if (!plugin_cmd_handler_exec ((server) ? server->name : "", command + 1, ptr_args))
526  #else  #else
# Line 572  exec_weechat_command (t_irc_server *serv Line 581  exec_weechat_command (t_irc_server *serv
581                  }                  }
582                  free_exploded_string (argv);                  free_exploded_string (argv);
583                  free (command);                  free (command);
584                    if (ptr_args_color)
585                        free (ptr_args_color);
586                  return 1;                  return 1;
587              }              }
588          }          }
# Line 619  exec_weechat_command (t_irc_server *serv Line 630  exec_weechat_command (t_irc_server *serv
630                                      _("%s command \"%s\" needs a server connection!\n"),                                      _("%s command \"%s\" needs a server connection!\n"),
631                                      WEECHAT_ERROR, irc_commands[i].command_name);                                      WEECHAT_ERROR, irc_commands[i].command_name);
632                          free (command);                          free (command);
633                            if (ptr_args_color)
634                                free (ptr_args_color);
635                          return 0;                          return 0;
636                      }                      }
637                      if (irc_commands[i].cmd_function_args)                      if (irc_commands[i].cmd_function_args)
# Line 637  exec_weechat_command (t_irc_server *serv Line 650  exec_weechat_command (t_irc_server *serv
650                  }                  }
651                  free_exploded_string (argv);                  free_exploded_string (argv);
652                  free (command);                  free (command);
653                    if (ptr_args_color)
654                        free (ptr_args_color);
655                  return 1;                  return 1;
656              }              }
657          }          }
# Line 665  exec_weechat_command (t_irc_server *serv Line 680  exec_weechat_command (t_irc_server *serv
680                                    
681                  free_exploded_string (argv);                  free_exploded_string (argv);
682                  free (command);                  free (command);
683                    if (ptr_args_color)
684                        free (ptr_args_color);
685                  return 1;                  return 1;
686              }              }
687          }          }
# Line 676  exec_weechat_command (t_irc_server *serv Line 693  exec_weechat_command (t_irc_server *serv
693          free_exploded_string (argv);          free_exploded_string (argv);
694      }      }
695      free (command);      free (command);
696        if (ptr_args_color)
697            free (ptr_args_color);
698      return 0;      return 0;
699  }  }
700    

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26