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