Changeset d4927a7


Ignore:
Timestamp:
Feb 11, 2011, 4:31:46 PM (7 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>
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    rddbbcffa rd4927a7  
    136136  priv=g_new0(struct owlfaim_priv, 1);
    137137
    138   priv->screenname = owl_strdup(screenname);
    139   priv->password = owl_strdup(password);
    140   priv->server = owl_strdup(FAIM_LOGIN_SERVER);
     138  priv->screenname = g_strdup(screenname);
     139  priv->password = g_strdup(password);
     140  priv->server = g_strdup(FAIM_LOGIN_SERVER);
    141141  sess->aux_data = priv;
    142142
     
    346346  /* there is a max away message lentgh we should check against */
    347347
    348   foo=owl_strdup(msg);
     348  foo=g_strdup(msg);
    349349  len=strlen(foo);
    350350  if (len>500) {
     
    10251025
    10261026  if (!args->msg) {
    1027     realmsg = owl_strdup("");
     1027    realmsg = g_strdup("");
    10281028  } else if (args->icbmflags & AIM_IMFLAGS_UNICODE) {
    10291029    realmsg = g_convert(args->msg, args->msglen, "UTF-8", "UCS-2BE",
     
    10331033                        NULL, NULL, NULL);
    10341034  } else {
    1035     realmsg = owl_strdup(args->msg);
     1035    realmsg = g_strdup(args->msg);
    10361036  }
    10371037
    10381038  if (!realmsg) {
    1039     realmsg = owl_strdup("[Error decoding incoming IM]");
     1039    realmsg = g_strdup("[Error decoding incoming IM]");
    10401040  }
    10411041
  • buddy.c

    rddbbcffa rd4927a7  
    44{
    55  b->proto=proto;
    6   b->name=owl_strdup(name);
     6  b->name=g_strdup(name);
    77  b->idlesince=0;
    88}
  • 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);
  • commands.c

    rddbbcffa rd4927a7  
    12741274      argc-=1; argv+=1;
    12751275    } else if (argc>=2 && !strcmp(argv[1], "--filter")) {
    1276       filter = owl_strdup(argv[2]);
     1276      filter = g_strdup(argv[2]);
    12771277      argc-=2; argv+=2;
    12781278    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
     
    13041304      argc-=1; argv+=1;
    13051305    } else if (argc>=2 && !strcmp(argv[1], "--filter")) {
    1306       filter = owl_strdup(argv[2]);
     1306      filter = g_strdup(argv[2]);
    13071307      argc-=2; argv+=2;
    13081308    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
     
    16751675    return NULL;
    16761676  }
    1677   newbuff = owl_strdup(skiptokens(buff, 1));
     1677  newbuff = g_strdup(skiptokens(buff, 1));
    16781678  if (!strcmp(argv[0], "(")) {
    16791679    for (i=strlen(newbuff)-1; i>=0; i--) {
     
    25012501  }
    25022502  filtname = owl_view_get_filtname(owl_global_get_current_view(&g));
    2503   if (filtname) return owl_strdup(filtname);
     2503  if (filtname) return g_strdup(filtname);
    25042504  return NULL;
    25052505}
     
    25162516    return NULL;
    25172517  }
    2518   return owl_strdup(tmpbuff);
     2518  return g_strdup(tmpbuff);
    25192519}
    25202520
     
    25762576  if (argc==2) {
    25772577    owl_editwin *e = owl_function_start_password("AIM Password: ");
    2578     owl_editwin_set_cbdata(e, owl_strdup(argv[1]), g_free);
     2578    owl_editwin_set_cbdata(e, g_strdup(argv[1]), g_free);
    25792579    owl_editwin_set_callback(e, owl_callback_aimlogin);
    25802580    return(NULL);
     
    26042604  }
    26052605  stylename = owl_view_get_style_name(owl_global_get_current_view(&g));
    2606   if (stylename) return owl_strdup(stylename);
     2606  if (stylename) return g_strdup(stylename);
    26072607  return NULL;
    26082608}
  • context.c

    rddbbcffa rd4927a7  
    1515  c->data = data;
    1616  c->cursor = cursor ? g_object_ref(cursor) : NULL;
    17   c->keymap = owl_strdup(keymap);
     17  c->keymap = g_strdup(keymap);
    1818  return c;
    1919}
  • dict.c

    rddbbcffa rd4927a7  
    6565  if (owl_list_create(l)) return(-1);
    6666  for (i=0; i<d->size; i++) {
    67     if ((dupk = owl_strdup(d->els[i].k)) == NULL) return(-1);
     67    if ((dupk = g_strdup(d->els[i].k)) == NULL) return(-1);
    6868    owl_list_append_element(l, dupk);
    6969  }
     
    100100      if (d->els==NULL) return(-1);
    101101    }
    102     if ((dupk = owl_strdup(k)) == NULL) return(-1);
     102    if ((dupk = g_strdup(k)) == NULL) return(-1);
    103103    if (pos!=d->size) {
    104104      /* shift forward to leave us a slot */
  • errqueue.c

    r5b256de rd4927a7  
    88void owl_errqueue_append_err(owl_errqueue *eq, const char *msg)
    99{
    10   owl_list_append_element(&(eq->errlist), owl_strdup(msg));
     10  owl_list_append_element(&(eq->errlist), g_strdup(msg));
    1111}
    1212
  • filter.c

    rddbbcffa rd4927a7  
    2121  f = g_new(owl_filter, 1);
    2222
    23   f->name=owl_strdup(name);
     23  f->name=g_strdup(name);
    2424  f->fgcolor=OWL_COLOR_DEFAULT;
    2525  f->bgcolor=OWL_COLOR_DEFAULT;
  • filterelement.c

    rddbbcffa rd4927a7  
    214214{
    215215  owl_filterelement_create(fe);
    216   fe->field=owl_strdup(field);
     216  fe->field=g_strdup(field);
    217217  if(owl_regex_create(&(fe->re), re)) {
    218218    g_free(fe->field);
     
    228228{
    229229  owl_filterelement_create(fe);
    230   fe->field=owl_strdup(name);
     230  fe->field=g_strdup(name);
    231231  fe->match_message = owl_filterelement_match_filter;
    232232  fe->print_elt = owl_filterelement_print_filter;
     
    236236{
    237237  owl_filterelement_create(fe);
    238   fe->field=owl_strdup(name);
     238  fe->field=g_strdup(name);
    239239  fe->match_message = owl_filterelement_match_perl;
    240240  fe->print_elt = owl_filterelement_print_perl;
  • functions.c

    rddbbcffa rd4927a7  
    358358  owl_function_start_edit_win(line,
    359359                              &owl_callback_aimwrite,
    360                               owl_strdup(to),
     360                              g_strdup(to),
    361361                              g_free);
    362362  g_free(line);
     
    436436    owl_zwrite_set_message(z, msg);
    437437  }
    438   old_msg = owl_strdup(owl_zwrite_get_message(z));
     438  old_msg = g_strdup(owl_zwrite_get_message(z));
    439439
    440440  zcrypt = owl_sprintf("%s/zcrypt", owl_get_bindir());
     
    491491
    492492  /* make a formatted copy of the message */
    493   format_msg = owl_strdup(msg);
     493  format_msg = g_strdup(msg);
    494494  if (unwrap)
    495495    owl_text_wordunwrap(format_msg);
     
    522522
    523523  /* make a formatted copy of the message */
    524   format_msg=owl_strdup(msg);
     524  format_msg=g_strdup(msg);
    525525  owl_text_wordunwrap(format_msg);
    526526 
     
    21912191 
    21922192  if (!strncmp(filtername, "not-", 4)) {
    2193     newname=owl_strdup(filtername+4);
     2193    newname=g_strdup(filtername+4);
    21942194  } else {
    21952195    newname=owl_sprintf("not-%s", filtername);
     
    22972297    }
    22982298  } else {
    2299     class = owl_strdup(c);
     2299    class = g_strdup(c);
    23002300    if (i) {
    2301       instance = owl_strdup(i);
     2301      instance = g_strdup(i);
    23022302    }
    23032303  }
     
    24292429  /* if it already exists then go with it.  This lets users override */
    24302430  if (owl_global_get_filter(&g, filtname)) {
    2431     return(owl_strdup(filtname));
     2431    return(g_strdup(filtname));
    24322432  }
    24332433
     
    30513051        timestr=owl_util_minutes_to_timestr(idle);
    30523052      } else {
    3053         timestr=owl_strdup("");
     3053        timestr=g_strdup("");
    30543054      }
    30553055      owl_fmtext_appendf_normal(&fm, "  %-20.20s %-12.12s\n", owl_buddy_get_name(b), timestr);
     
    32863286  if (!filename) {
    32873287    fail_silent = 1;
    3288     path = owl_strdup(owl_global_get_startupfile(&g));
     3288    path = g_strdup(owl_global_get_startupfile(&g));
    32893289  } else {
    32903290    path = owl_util_makepath(filename);
     
    33893389
    33903390  now=time(NULL);
    3391   date=owl_strdup(ctime(&now));
     3391  date=g_strdup(ctime(&now));
    33923392  date[strlen(date)-1]='\0';
    33933393
  • global.c

    rddbbcffa rd4927a7  
    2626  hent=gethostbyname(hostname);
    2727  if (!hent) {
    28     g->thishost=owl_strdup("localhost");
     28    g->thishost=g_strdup("localhost");
    2929  } else {
    30     g->thishost=owl_strdup(hent->h_name);
     30    g->thishost=g_strdup(hent->h_name);
    3131  }
    3232
     
    9090  if (!homedir)
    9191    homedir = g_get_home_dir();
    92   g->homedir = owl_strdup(homedir);
     92  g->homedir = g_strdup(homedir);
    9393
    9494  g->confdir = NULL;
     
    380380void owl_global_set_confdir(owl_global *g, const char *cd) {
    381381  g_free(g->confdir);
    382   g->confdir = owl_strdup(cd);
     382  g->confdir = g_strdup(cd);
    383383  g_free(g->startupfile);
    384384  g->startupfile = owl_sprintf("%s/startup", cd);
     
    701701  if (g->aim_screenname) g_free(g->aim_screenname);
    702702  if (g->aim_screenname_for_filters) g_free(g->aim_screenname_for_filters);
    703   g->aim_screenname=owl_strdup(screenname);
     703  g->aim_screenname=g_strdup(screenname);
    704704  sn_escaped = owl_text_quote(screenname, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    705705  g->aim_screenname_for_filters = owl_arg_quote(sn_escaped);
     
    973973
    974974    g_free(open_file);
    975     open_file = owl_strdup(filename);
     975    open_file = g_strdup(filename);
    976976  }
    977977  return g->debug_file;
  • history.c

    rddbbcffa rd4927a7  
    6969
    7070  /* add the new line */
    71   owl_list_prepend_element(&(h->hist), owl_strdup(line));
     71  owl_list_prepend_element(&(h->hist), g_strdup(line));
    7272}
    7373
  • keybinding.c

    rddbbcffa rd4927a7  
    2727  }
    2828
    29   if (command) kb->command = owl_strdup(command);
     29  if (command) kb->command = g_strdup(command);
    3030  kb->function_fn = function_fn;
    31   if (desc) kb->desc = owl_strdup(desc);
     31  if (desc) kb->desc = g_strdup(desc);
    3232  else kb->desc = NULL;
    3333  return(0);
  • keymap.c

    rddbbcffa rd4927a7  
    99{
    1010  if (!name || !desc) return(-1);
    11   if ((km->name = owl_strdup(name)) == NULL) return(-1);
    12   if ((km->desc = owl_strdup(desc)) == NULL) return(-1);
     11  if ((km->name = g_strdup(name)) == NULL) return(-1);
     12  if ((km->desc = g_strdup(desc)) == NULL) return(-1);
    1313  if (0 != owl_list_create(&km->bindings)) return(-1);
    1414  km->parent = NULL;
  • logging.c

    rddbbcffa rd4927a7  
    159159    g_free(temp);
    160160  } else {
    161     to = owl_strdup("loopback");
     161    to = g_strdup("loopback");
    162162  }
    163163
     
    262262      from=frombuff=short_zuser(owl_message_get_sender(m));
    263263    } else {
    264       from=frombuff=owl_strdup(owl_message_get_class(m));
     264      from=frombuff=g_strdup(owl_message_get_class(m));
    265265    }
    266266  } else if (owl_message_is_type_aim(m)) {
     
    273273    g_free(temp);
    274274  } else if (owl_message_is_type_loopback(m)) {
    275     from=frombuff=owl_strdup("loopback");
     275    from=frombuff=g_strdup("loopback");
    276276  } else if (owl_message_is_type_jabber(m)) {
    277277    if (personal) {
     
    281281    }
    282282  } else {
    283     from=frombuff=owl_strdup("unknown");
     283    from=frombuff=g_strdup("unknown");
    284284  }
    285285 
  • message.c

    rddbbcffa rd4927a7  
    4747  /* save the time */
    4848  m->time=time(NULL);
    49   m->timestr=owl_strdup(ctime(&(m->time)));
     49  m->timestr=g_strdup(ctime(&(m->time)));
    5050  m->timestr[strlen(m->timestr)-1]='\0';
    5151
     
    131131      buff=owl_sprintf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), "<error>");
    132132      if(buff == NULL)
    133         buff=owl_strdup("   <error>\n");
     133        buff=g_strdup("   <error>\n");
    134134    }
    135135    owl_fmtext_append_normal(fm, buff);
     
    586586  cur+=3;
    587587  while (*cur && *cur==' ') cur++;
    588   out = owl_strdup(cur);
     588  out = g_strdup(cur);
    589589  end = strchr(out, '\n');
    590590  if (end) end[0] = '\0';
     
    609609    shortuser = short_zuser(user);
    610610    if (strcasecmp(shortuser, recip) != 0) {
    611       out = g_list_prepend(out, owl_strdup(user));
     611      out = g_list_prepend(out, g_strdup(user));
    612612    }
    613613    g_free(shortuser);
     
    795795  if (m->timestr) g_free(m->timestr);
    796796  m->time=n->z_time.tv_sec;
    797   m->timestr=owl_strdup(ctime(&(m->time)));
     797  m->timestr=g_strdup(ctime(&(m->time)));
    798798  m->timestr[strlen(m->timestr)-1]='\0';
    799799
  • msgwin.c

    rddbbcffa rd4927a7  
    2424void owl_msgwin_set_text(owl_msgwin *msgwin, const char *msg)
    2525{
    26   owl_msgwin_set_text_nocopy(msgwin, owl_strdup(msg));
     26  owl_msgwin_set_text_nocopy(msgwin, g_strdup(msg));
    2727}
    2828
  • owl.c

    rddbbcffa rd4927a7  
    8080      break;
    8181    case 'c':
    82       opts->configfile = owl_strdup(optarg);
     82      opts->configfile = g_strdup(optarg);
    8383      break;
    8484    case 's':
    85       opts->confdir = owl_strdup(optarg);
     85      opts->confdir = g_strdup(optarg);
    8686      break;
    8787    case 't':
    88       opts->tty = owl_strdup(optarg);
     88      opts->tty = g_strdup(optarg);
    8989      break;
    9090    case 'D':
  • perlconfig.c

    rddbbcffa rd4927a7  
    148148  type = owl_message_get_type(m);
    149149  if(!type || !*type) type = "generic";
    150   utype = owl_strdup(type);
     150  utype = g_strdup(type);
    151151  utype[0] = toupper(type[0]);
    152152  blessas = owl_sprintf("BarnOwl::Message::%s", utype);
     
    214214      owl_message_set_zwriteline(m, val);
    215215    } else if (!strcmp(key, "time")) {
    216       m->timestr = owl_strdup(val);
     216      m->timestr = g_strdup(val);
    217217      strptime(val, "%a %b %d %T %Y", &tm);
    218218      m->time = mktime(&tm);
     
    282282
    283283  if (srv) {
    284     out = owl_strdup(SvPV_nolen(srv));
     284    out = g_strdup(SvPV_nolen(srv));
    285285  } else {
    286286    out = NULL;
     
    335335
    336336  if (srv) {
    337     out = owl_strdup(SvPV_nolen(srv));
     337    out = g_strdup(SvPV_nolen(srv));
    338338  } else {
    339339    out = NULL;
     
    369369  ret=perl_parse(p, owl_perl_xs_init, 2, (char **)args, NULL);
    370370  if (ret || SvTRUE(ERRSV)) {
    371     err=owl_strdup(SvPV_nolen(ERRSV));
     371    err=g_strdup(SvPV_nolen(ERRSV));
    372372    sv_setsv(ERRSV, &PL_sv_undef);     /* and clear the error */
    373373    return(err);
     
    376376  ret=perl_run(p);
    377377  if (ret || SvTRUE(ERRSV)) {
    378     err=owl_strdup(SvPV_nolen(ERRSV));
     378    err=g_strdup(SvPV_nolen(ERRSV));
    379379    sv_setsv(ERRSV, &PL_sv_undef);     /* and clear the error */
    380380    return(err);
     
    412412
    413413  if (SvTRUE(ERRSV)) {
    414     err=owl_strdup(SvPV_nolen(ERRSV));
     414    err=g_strdup(SvPV_nolen(ERRSV));
    415415    sv_setsv (ERRSV, &PL_sv_undef);     /* and clear the error */
    416416    return(err);
     
    450450  }
    451451
    452   out = owl_strdup(SvPV(response, len));
     452  out = g_strdup(SvPV(response, len));
    453453  FREETMPS;
    454454  LEAVE;
     
    529529    rv = POPs;
    530530    if(SvTRUE(rv)) {
    531       ret = owl_strdup(SvPV_nolen(rv));
     531      ret = g_strdup(SvPV_nolen(rv));
    532532    }
    533533  }
  • regex.c

    rddbbcffa rd4927a7  
    1414  const char *ptr;
    1515 
    16   re->string=owl_strdup(string);
     16  re->string=g_strdup(string);
    1717
    1818  ptr=string;
  • select.c

    rddbbcffa rd4927a7  
    2323  t->destroy = destroy;
    2424  t->data = data;
    25   t->name = name ? owl_strdup(name) : NULL;
     25  t->name = name ? g_strdup(name) : NULL;
    2626
    2727  *timers = g_list_insert_sorted(*timers, t,
  • style.c

    rddbbcffa rd4927a7  
    55void owl_style_create_perl(owl_style *s, const char *name, SV *obj)
    66{
    7   s->name=owl_strdup(name);
     7  s->name=g_strdup(name);
    88  s->perlobj = obj;
    99}
  • text.c

    rddbbcffa rd4927a7  
    193193  int cur, lastspace, len, lastnewline;
    194194
    195   out=owl_strdup(in);
     195  out=g_strdup(in);
    196196  len=strlen(in);
    197197  cur=0;
     
    276276  int   outlen, tolen, fromlen, inpos=0, outpos=0;
    277277
    278   if (!*from) return owl_strdup(in);
     278  if (!*from) return g_strdup(in);
    279279
    280280  outlen = strlen(in)+1;
  • util.c

    rddbbcffa rd4927a7  
    292292}
    293293
    294 /* hooks for doing memory allocation et. al. in owl */
    295 
    296 char *owl_strdup(const char *s1)
    297 {
    298   return(g_strdup(s1));
    299 }
    300 
    301294/* allocates memory and returns the string or null.
    302295 * caller must free the string.
     
    363356
    364357  if (getenv("DISPLAY")) {
    365     out=owl_strdup(getenv("DISPLAY"));
     358    out=g_strdup(getenv("DISPLAY"));
    366359  } else if ((tmp=ttyname(fileno(stdout)))!=NULL) {
    367     out=owl_strdup(tmp);
     360    out=g_strdup(tmp);
    368361    if (!strncmp(out, "/dev/", 5)) {
    369362      g_free(out);
    370       out=owl_strdup(tmp+5);
     363      out=g_strdup(tmp+5);
    371364    }
    372365  } else {
    373     out=owl_strdup("unknown");
     366    out=g_strdup("unknown");
    374367  }
    375368  return(out);
     
    384377  char  *tmp, *ptr1, *ptr2, *out;
    385378
    386   ptr1=tmp=owl_strdup(in);
     379  ptr1=tmp=g_strdup(in);
    387380  while (ptr1[0]=='\n') {
    388381    ptr1++;
     
    394387  }
    395388
    396   out=owl_strdup(ptr1);
     389  out=g_strdup(ptr1);
    397390  g_free(tmp);
    398391  return(out);
     
    545538  }
    546539
    547   start = owl_strdup(class);
     540  start = g_strdup(class);
    548541  end = start + strlen(start) - 1;
    549542  while(end > start && *end == 'd' && *(end-1) == '.') {
     
    601594  }
    602595  else {
    603     r = owl_strdup("");
     596    r = g_strdup("");
    604597  }
    605598  return r;
     
    630623  char *out;
    631624  if (g_utf8_validate(in, -1, NULL)) {
    632     out = owl_strdup(in);
     625    out = g_strdup(in);
    633626  } else {
    634     out = owl_strdup("");
     627    out = g_strdup("");
    635628  }
    636629  return out;
  • variable.c

    rddbbcffa rd4927a7  
    482482    *cur = *var;
    483483    /* strdup all the strings so we can delete them consistently. */
    484     cur->name = owl_strdup(var->name);
    485     cur->summary = owl_strdup(var->summary);
    486     cur->description = owl_strdup(var->description);
     484    cur->name = g_strdup(var->name);
     485    cur->summary = g_strdup(var->summary);
     486    cur->description = g_strdup(var->description);
    487487    switch (cur->type) {
    488488    case OWL_VARIABLE_OTHER:
     
    552552owl_variable * owl_variable_newvar(const char *name, const char *summary, const char * description) {
    553553  owl_variable * var = g_new0(owl_variable, 1);
    554   var->name = owl_strdup(name);
    555   var->summary = owl_strdup(summary);
    556   var->description = owl_strdup(description);
     554  var->name = g_strdup(name);
     555  var->summary = g_strdup(summary);
     556  var->description = g_strdup(description);
    557557  return var;
    558558}
     
    560560void owl_variable_update(owl_variable *var, const char *summary, const char *desc) {
    561561  if(var->summary) g_free(var->summary);
    562   var->summary = owl_strdup(summary);
     562  var->summary = g_strdup(summary);
    563563  if(var->description) g_free(var->description);
    564   var->description = owl_strdup(desc);
     564  var->description = g_strdup(desc);
    565565}
    566566
     
    570570    owl_variable_update(old, summ, desc);
    571571    if(old->pval_default) g_free(old->pval_default);
    572     old->pval_default = owl_strdup(initval);
     572    old->pval_default = g_strdup(initval);
    573573  } else {
    574574    owl_variable * var = owl_variable_newvar(name, summ, desc);
    575575    var->type = OWL_VARIABLE_STRING;
    576     var->pval_default = owl_strdup(initval);
     576    var->pval_default = g_strdup(initval);
    577577    var->set_fn = owl_variable_string_set_default;
    578578    var->set_fromstring_fn = owl_variable_string_set_fromstring_default;
     
    10091009  }
    10101010  if (v->val) g_free(v->val);
    1011   v->val = owl_strdup(newval);
     1011  v->val = g_strdup(newval);
    10121012  return(0);
    10131013}
  • view.c

    rddbbcffa rd4927a7  
    44void owl_view_create(owl_view *v, const char *name, owl_filter *f, const owl_style *s)
    55{
    6   v->name=owl_strdup(name);
     6  v->name=g_strdup(name);
    77  v->filter=f;
    88  v->style=s;
  • zephyr.c

    rddbbcffa rd4927a7  
    2323{
    2424  if (input != NULL)
    25     return owl_strdup(input);
     25    return g_strdup(input);
    2626  else
    2727    return owl_sprintf("%s/%s", owl_global_get_homedir(&g), name);
     
    292292    if ((tmp = strtok(start, ",\n\r")) == NULL)
    293293      continue;
    294     subs[count].zsub_class = owl_strdup(tmp);
     294    subs[count].zsub_class = g_strdup(tmp);
    295295    if ((tmp=strtok(NULL, ",\n\r")) == NULL)
    296296      continue;
    297     subs[count].zsub_classinst = owl_strdup(tmp);
     297    subs[count].zsub_classinst = g_strdup(tmp);
    298298    if ((tmp = strtok(NULL, " \t\n\r")) == NULL)
    299299      continue;
    300     subs[count].zsub_recipient = owl_strdup(tmp);
     300    subs[count].zsub_recipient = g_strdup(tmp);
    301301
    302302    /* if it started with '-' then add it to the global punt list, and
     
    337337  count=0;
    338338
    339   subs[count].zsub_class=owl_strdup("message");
    340   subs[count].zsub_classinst=owl_strdup("*");
    341   subs[count].zsub_recipient=owl_strdup("%me%");
     339  subs[count].zsub_class=g_strdup("message");
     340  subs[count].zsub_classinst=g_strdup("*");
     341  subs[count].zsub_recipient=g_strdup("%me%");
    342342  count++;
    343343
     
    400400      }
    401401
    402       subs[count].zsub_class = owl_strdup("login");
    403       subs[count].zsub_recipient = owl_strdup("*");
     402      subs[count].zsub_class = g_strdup("login");
     403      subs[count].zsub_recipient = g_strdup("*");
    404404      subs[count].zsub_classinst = long_zuser(buffer);
    405405
     
    483483  /* If there's no message here, just run along now */
    484484  if (n->z_message_len == 0)
    485     return(owl_strdup(""));
     485    return(g_strdup(""));
    486486
    487487  count=save=0;
     
    491491      if (count==j) {
    492492        /* just found the end of the field we're looking for */
    493         return(owl_strdup(n->z_message+save));
     493        return(g_strdup(n->z_message+save));
    494494      } else {
    495495        save=i+1;
     
    502502  }
    503503
    504   return(owl_strdup(""));
     504  return(g_strdup(""));
    505505}
    506506
     
    511511  /* If there's no message here, just run along now */
    512512  if (n->z_message_len == 0)
    513     return(owl_strdup(""));
     513    return(g_strdup(""));
    514514
    515515  count=save=0;
     
    534534  }
    535535
    536   return(owl_strdup(""));
     536  return(g_strdup(""));
    537537}
    538538#else
    539539char *owl_zephyr_get_field(void *n, int j)
    540540{
    541   return(owl_strdup(""));
     541  return(g_strdup(""));
    542542}
    543543char *owl_zephyr_get_field_as_utf8(void *n, int j)
     
    578578  /* don't let ping messages have a body */
    579579  if (!strcasecmp(n->z_opcode, "ping")) {
    580     return(owl_strdup(""));
     580    return(g_strdup(""));
    581581  }
    582582
     
    804804
    805805      memset(&zw, 0, sizeof(zw));
    806       zw.class = owl_strdup(retnotice->z_class);
    807       zw.inst  = owl_strdup(retnotice->z_class_inst);
     806      zw.class = g_strdup(retnotice->z_class);
     807      zw.inst  = g_strdup(retnotice->z_class_inst);
    808808      realm = strchr(retnotice->z_recipient, '@');
    809809      if(realm) {
    810         zw.realm = owl_strdup(realm + 1);
     810        zw.realm = g_strdup(realm + 1);
    811811      } else {
    812         zw.realm = owl_strdup(owl_zephyr_get_realm());
     812        zw.realm = g_strdup(owl_zephyr_get_realm());
    813813      }
    814       zw.opcode = owl_strdup(retnotice->z_opcode);
    815       zw.zsig   = owl_strdup("");
     814      zw.opcode = g_strdup(retnotice->z_opcode);
     815      zw.zsig   = g_strdup("");
    816816      owl_list_create(&(zw.recips));
    817       owl_list_append_element(&(zw.recips), owl_strdup(tmp));
     817      owl_list_append_element(&(zw.recips), g_strdup(tmp));
    818818
    819819      owl_log_outgoing_zephyr_error(&zw, buff);
     
    870870    to=owl_zephyr_smartstripped_user(owl_message_get_sender(m));
    871871  } else {
    872     to=owl_strdup(owl_message_get_sender(m));
     872    to=g_strdup(owl_message_get_sender(m));
    873873  }
    874874
     
    934934    result = owl_sprintf("%s: Hidden or not logged in\n", myuser);
    935935  } else {
    936     result = owl_strdup("");
     936    result = g_strdup("");
    937937    for (; numlocs; numlocs--) {
    938938      ZGetLocations(&locations, &one);
     
    950950  return result;
    951951#else
    952   return owl_strdup("");
     952  return g_strdup("");
    953953#endif
    954954}
     
    11321132  ret=ZRetrieveSubscriptions(0, &num);
    11331133  if (ret==ZERR_TOOMANYSUBS) {
    1134     return(owl_strdup("Zephyr: too many subscriptions\n"));
     1134    return(g_strdup("Zephyr: too many subscriptions\n"));
    11351135  } else if (ret || (num <= 0)) {
    1136     return(owl_strdup("Zephyr: error retriving subscriptions\n"));
     1136    return(g_strdup("Zephyr: error retriving subscriptions\n"));
    11371137  }
    11381138
     
    11431143      ZFlushSubscriptions();
    11441144      g_string_free(buf, true);
    1145       return owl_strdup("Error while getting subscriptions\n");
     1145      return g_strdup("Error while getting subscriptions\n");
    11461146    } else {
    11471147      /* g_string_append_printf would be backwards. */
     
    11581158  return g_string_free(buf, false);
    11591159#else
    1160   return(owl_strdup("Zephyr not available"));
     1160  return(g_strdup("Zephyr not available"));
    11611161#endif
    11621162}
     
    11851185  char *out, *ptr;
    11861186
    1187   out=owl_strdup(in);
     1187  out=g_strdup(in);
    11881188  ptr=strchr(out, '@');
    11891189  if (ptr) {
     
    12011201{
    12021202  if (strchr(in, '@')) {
    1203     return(owl_strdup(in));
     1203    return(g_strdup(in));
    12041204  }
    12051205  return(owl_sprintf("%s@%s", in, owl_zephyr_get_realm()));
     
    12151215  char *slash, *dot, *realm, *out;
    12161216
    1217   out = owl_strdup(in);
     1217  out = g_strdup(in);
    12181218
    12191219  /* bail immeaditly if we don't have to do any work */
  • zwrite.c

    rddbbcffa rd4927a7  
    3535  z->noping=0;
    3636  owl_list_create(&(z->recips));
    37   z->zwriteline = owl_strdup(line);
     37  z->zwriteline = g_strdup(line);
    3838
    3939  /* parse the command line for options */
     
    4646  myargc=argc;
    4747  if (myargc && *(myargv[0])!='-') {
    48     z->cmd=owl_strdup(myargv[0]);
     48    z->cmd=g_strdup(myargv[0]);
    4949    myargc--;
    5050    myargv++;
     
    137137
    138138  /* now deal with defaults */
    139   if (z->class==NULL) z->class=owl_strdup("message");
    140   if (z->inst==NULL) z->inst=owl_strdup("personal");
    141   if (z->realm==NULL) z->realm=owl_strdup("");
    142   if (z->opcode==NULL) z->opcode=owl_strdup("");
     139  if (z->class==NULL) z->class=g_strdup("message");
     140  if (z->inst==NULL) z->inst=g_strdup("personal");
     141  if (z->realm==NULL) z->realm=g_strdup("");
     142  if (z->opcode==NULL) z->opcode=g_strdup("");
    143143  /* z->message is allowed to stay NULL */
    144144
     
    178178      to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
    179179    } else {
    180       to = owl_strdup(owl_list_get_element(&(z->recips), i));
     180      to = g_strdup(owl_list_get_element(&(z->recips), i));
    181181    }
    182182    send_ping(to, z->class, z->inst);
     
    203203  j=owl_list_get_size(&(z->recips));
    204204  if (j>0 && z->cc) {
    205     toline = owl_strdup( "CC: ");
     205    toline = g_strdup( "CC: ");
    206206    for (i=0; i<j; i++) {
    207207      tmp = toline;
     
    252252        to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
    253253      } else {
    254         to = owl_strdup( owl_list_get_element(&(z->recips), i));
     254        to = g_strdup( owl_list_get_element(&(z->recips), i));
    255255      }
    256256      ret = send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
     
    319319{
    320320  if(z->zsig) g_free(z->zsig);
    321   z->zsig = owl_strdup(zsig);
     321  z->zsig = g_strdup(zsig);
    322322}
    323323
Note: See TracChangeset for help on using the changeset viewer.