Changeset d4927a7 for cmd.c


Ignore:
Timestamp:
Feb 11, 2011, 4:31:46 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
3472845
Parents:
ddbbcffa
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:55:10)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:46)
Message:
Replace owl_strdup with g_strdup.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Karl Ramm <kcr@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    rddbbcffa rd4927a7  
    8888  char *retval = NULL;
    8989
    90   tmpbuff=owl_strdup(cmdbuff);
     90  tmpbuff=g_strdup(cmdbuff);
    9191  argv=owl_parseline(tmpbuff, &argc);
    9292  if (argc < 0) {
     
    135135  *cmd = *templ;
    136136  if (!templ->name) return(-1);
    137   cmd->name = owl_strdup(templ->name);
    138   if (templ->summary)     cmd->summary     = owl_strdup(templ->summary);
    139   if (templ->usage)       cmd->usage       = owl_strdup(templ->usage);
    140   if (templ->description) cmd->description = owl_strdup(templ->description);
    141   if (templ->cmd_aliased_to) cmd->cmd_aliased_to = owl_strdup(templ->cmd_aliased_to);
     137  cmd->name = g_strdup(templ->name);
     138  if (templ->summary)     cmd->summary     = g_strdup(templ->summary);
     139  if (templ->usage)       cmd->usage       = g_strdup(templ->usage);
     140  if (templ->description) cmd->description = g_strdup(templ->description);
     141  if (templ->cmd_aliased_to) cmd->cmd_aliased_to = g_strdup(templ->cmd_aliased_to);
    142142  return(0);
    143143}
     
    145145int owl_cmd_create_alias(owl_cmd *cmd, const char *name, const char *aliased_to) {
    146146  memset(cmd, 0, sizeof(owl_cmd));
    147   cmd->name = owl_strdup(name);
    148   cmd->cmd_aliased_to = owl_strdup(aliased_to);
     147  cmd->name = g_strdup(name);
     148  cmd->cmd_aliased_to = g_strdup(aliased_to);
    149149  cmd->summary = owl_sprintf("%s%s", OWL_CMD_ALIAS_SUMMARY_PREFIX, aliased_to);
    150150  return(0);
Note: See TracChangeset for help on using the changeset viewer.