Changeset d4927a7 for zephyr.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
  • 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 */
Note: See TracChangeset for help on using the changeset viewer.