Changeset d4927a7
- Timestamp:
- Feb 11, 2011, 4:31:46 PM (14 years ago)
- Branches:
- master, release-1.10, 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)
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
rddbbcffa rd4927a7 136 136 priv=g_new0(struct owlfaim_priv, 1); 137 137 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); 141 141 sess->aux_data = priv; 142 142 … … 346 346 /* there is a max away message lentgh we should check against */ 347 347 348 foo= owl_strdup(msg);348 foo=g_strdup(msg); 349 349 len=strlen(foo); 350 350 if (len>500) { … … 1025 1025 1026 1026 if (!args->msg) { 1027 realmsg = owl_strdup("");1027 realmsg = g_strdup(""); 1028 1028 } else if (args->icbmflags & AIM_IMFLAGS_UNICODE) { 1029 1029 realmsg = g_convert(args->msg, args->msglen, "UTF-8", "UCS-2BE", … … 1033 1033 NULL, NULL, NULL); 1034 1034 } else { 1035 realmsg = owl_strdup(args->msg);1035 realmsg = g_strdup(args->msg); 1036 1036 } 1037 1037 1038 1038 if (!realmsg) { 1039 realmsg = owl_strdup("[Error decoding incoming IM]");1039 realmsg = g_strdup("[Error decoding incoming IM]"); 1040 1040 } 1041 1041 -
buddy.c
rddbbcffa rd4927a7 4 4 { 5 5 b->proto=proto; 6 b->name= owl_strdup(name);6 b->name=g_strdup(name); 7 7 b->idlesince=0; 8 8 } -
cmd.c
rddbbcffa rd4927a7 88 88 char *retval = NULL; 89 89 90 tmpbuff= owl_strdup(cmdbuff);90 tmpbuff=g_strdup(cmdbuff); 91 91 argv=owl_parseline(tmpbuff, &argc); 92 92 if (argc < 0) { … … 135 135 *cmd = *templ; 136 136 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); 142 142 return(0); 143 143 } … … 145 145 int owl_cmd_create_alias(owl_cmd *cmd, const char *name, const char *aliased_to) { 146 146 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); 149 149 cmd->summary = owl_sprintf("%s%s", OWL_CMD_ALIAS_SUMMARY_PREFIX, aliased_to); 150 150 return(0); -
commands.c
rddbbcffa rd4927a7 1274 1274 argc-=1; argv+=1; 1275 1275 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 1276 filter = owl_strdup(argv[2]);1276 filter = g_strdup(argv[2]); 1277 1277 argc-=2; argv+=2; 1278 1278 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { … … 1304 1304 argc-=1; argv+=1; 1305 1305 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 1306 filter = owl_strdup(argv[2]);1306 filter = g_strdup(argv[2]); 1307 1307 argc-=2; argv+=2; 1308 1308 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { … … 1675 1675 return NULL; 1676 1676 } 1677 newbuff = owl_strdup(skiptokens(buff, 1));1677 newbuff = g_strdup(skiptokens(buff, 1)); 1678 1678 if (!strcmp(argv[0], "(")) { 1679 1679 for (i=strlen(newbuff)-1; i>=0; i--) { … … 2501 2501 } 2502 2502 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); 2504 2504 return NULL; 2505 2505 } … … 2516 2516 return NULL; 2517 2517 } 2518 return owl_strdup(tmpbuff);2518 return g_strdup(tmpbuff); 2519 2519 } 2520 2520 … … 2576 2576 if (argc==2) { 2577 2577 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); 2579 2579 owl_editwin_set_callback(e, owl_callback_aimlogin); 2580 2580 return(NULL); … … 2604 2604 } 2605 2605 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); 2607 2607 return NULL; 2608 2608 } -
context.c
rddbbcffa rd4927a7 15 15 c->data = data; 16 16 c->cursor = cursor ? g_object_ref(cursor) : NULL; 17 c->keymap = owl_strdup(keymap);17 c->keymap = g_strdup(keymap); 18 18 return c; 19 19 } -
dict.c
rddbbcffa rd4927a7 65 65 if (owl_list_create(l)) return(-1); 66 66 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); 68 68 owl_list_append_element(l, dupk); 69 69 } … … 100 100 if (d->els==NULL) return(-1); 101 101 } 102 if ((dupk = owl_strdup(k)) == NULL) return(-1);102 if ((dupk = g_strdup(k)) == NULL) return(-1); 103 103 if (pos!=d->size) { 104 104 /* shift forward to leave us a slot */ -
errqueue.c
r5b256de rd4927a7 8 8 void owl_errqueue_append_err(owl_errqueue *eq, const char *msg) 9 9 { 10 owl_list_append_element(&(eq->errlist), owl_strdup(msg));10 owl_list_append_element(&(eq->errlist), g_strdup(msg)); 11 11 } 12 12 -
filter.c
rddbbcffa rd4927a7 21 21 f = g_new(owl_filter, 1); 22 22 23 f->name= owl_strdup(name);23 f->name=g_strdup(name); 24 24 f->fgcolor=OWL_COLOR_DEFAULT; 25 25 f->bgcolor=OWL_COLOR_DEFAULT; -
filterelement.c
rddbbcffa rd4927a7 214 214 { 215 215 owl_filterelement_create(fe); 216 fe->field= owl_strdup(field);216 fe->field=g_strdup(field); 217 217 if(owl_regex_create(&(fe->re), re)) { 218 218 g_free(fe->field); … … 228 228 { 229 229 owl_filterelement_create(fe); 230 fe->field= owl_strdup(name);230 fe->field=g_strdup(name); 231 231 fe->match_message = owl_filterelement_match_filter; 232 232 fe->print_elt = owl_filterelement_print_filter; … … 236 236 { 237 237 owl_filterelement_create(fe); 238 fe->field= owl_strdup(name);238 fe->field=g_strdup(name); 239 239 fe->match_message = owl_filterelement_match_perl; 240 240 fe->print_elt = owl_filterelement_print_perl; -
functions.c
rddbbcffa rd4927a7 358 358 owl_function_start_edit_win(line, 359 359 &owl_callback_aimwrite, 360 owl_strdup(to),360 g_strdup(to), 361 361 g_free); 362 362 g_free(line); … … 436 436 owl_zwrite_set_message(z, msg); 437 437 } 438 old_msg = owl_strdup(owl_zwrite_get_message(z));438 old_msg = g_strdup(owl_zwrite_get_message(z)); 439 439 440 440 zcrypt = owl_sprintf("%s/zcrypt", owl_get_bindir()); … … 491 491 492 492 /* make a formatted copy of the message */ 493 format_msg = owl_strdup(msg);493 format_msg = g_strdup(msg); 494 494 if (unwrap) 495 495 owl_text_wordunwrap(format_msg); … … 522 522 523 523 /* make a formatted copy of the message */ 524 format_msg= owl_strdup(msg);524 format_msg=g_strdup(msg); 525 525 owl_text_wordunwrap(format_msg); 526 526 … … 2191 2191 2192 2192 if (!strncmp(filtername, "not-", 4)) { 2193 newname= owl_strdup(filtername+4);2193 newname=g_strdup(filtername+4); 2194 2194 } else { 2195 2195 newname=owl_sprintf("not-%s", filtername); … … 2297 2297 } 2298 2298 } else { 2299 class = owl_strdup(c);2299 class = g_strdup(c); 2300 2300 if (i) { 2301 instance = owl_strdup(i);2301 instance = g_strdup(i); 2302 2302 } 2303 2303 } … … 2429 2429 /* if it already exists then go with it. This lets users override */ 2430 2430 if (owl_global_get_filter(&g, filtname)) { 2431 return( owl_strdup(filtname));2431 return(g_strdup(filtname)); 2432 2432 } 2433 2433 … … 3051 3051 timestr=owl_util_minutes_to_timestr(idle); 3052 3052 } else { 3053 timestr= owl_strdup("");3053 timestr=g_strdup(""); 3054 3054 } 3055 3055 owl_fmtext_appendf_normal(&fm, " %-20.20s %-12.12s\n", owl_buddy_get_name(b), timestr); … … 3286 3286 if (!filename) { 3287 3287 fail_silent = 1; 3288 path = owl_strdup(owl_global_get_startupfile(&g));3288 path = g_strdup(owl_global_get_startupfile(&g)); 3289 3289 } else { 3290 3290 path = owl_util_makepath(filename); … … 3389 3389 3390 3390 now=time(NULL); 3391 date= owl_strdup(ctime(&now));3391 date=g_strdup(ctime(&now)); 3392 3392 date[strlen(date)-1]='\0'; 3393 3393 -
global.c
rddbbcffa rd4927a7 26 26 hent=gethostbyname(hostname); 27 27 if (!hent) { 28 g->thishost= owl_strdup("localhost");28 g->thishost=g_strdup("localhost"); 29 29 } else { 30 g->thishost= owl_strdup(hent->h_name);30 g->thishost=g_strdup(hent->h_name); 31 31 } 32 32 … … 90 90 if (!homedir) 91 91 homedir = g_get_home_dir(); 92 g->homedir = owl_strdup(homedir);92 g->homedir = g_strdup(homedir); 93 93 94 94 g->confdir = NULL; … … 380 380 void owl_global_set_confdir(owl_global *g, const char *cd) { 381 381 g_free(g->confdir); 382 g->confdir = owl_strdup(cd);382 g->confdir = g_strdup(cd); 383 383 g_free(g->startupfile); 384 384 g->startupfile = owl_sprintf("%s/startup", cd); … … 701 701 if (g->aim_screenname) g_free(g->aim_screenname); 702 702 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); 704 704 sn_escaped = owl_text_quote(screenname, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 705 705 g->aim_screenname_for_filters = owl_arg_quote(sn_escaped); … … 973 973 974 974 g_free(open_file); 975 open_file = owl_strdup(filename);975 open_file = g_strdup(filename); 976 976 } 977 977 return g->debug_file; -
history.c
rddbbcffa rd4927a7 69 69 70 70 /* add the new line */ 71 owl_list_prepend_element(&(h->hist), owl_strdup(line));71 owl_list_prepend_element(&(h->hist), g_strdup(line)); 72 72 } 73 73 -
keybinding.c
rddbbcffa rd4927a7 27 27 } 28 28 29 if (command) kb->command = owl_strdup(command);29 if (command) kb->command = g_strdup(command); 30 30 kb->function_fn = function_fn; 31 if (desc) kb->desc = owl_strdup(desc);31 if (desc) kb->desc = g_strdup(desc); 32 32 else kb->desc = NULL; 33 33 return(0); -
keymap.c
rddbbcffa rd4927a7 9 9 { 10 10 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); 13 13 if (0 != owl_list_create(&km->bindings)) return(-1); 14 14 km->parent = NULL; -
logging.c
rddbbcffa rd4927a7 159 159 g_free(temp); 160 160 } else { 161 to = owl_strdup("loopback");161 to = g_strdup("loopback"); 162 162 } 163 163 … … 262 262 from=frombuff=short_zuser(owl_message_get_sender(m)); 263 263 } else { 264 from=frombuff= owl_strdup(owl_message_get_class(m));264 from=frombuff=g_strdup(owl_message_get_class(m)); 265 265 } 266 266 } else if (owl_message_is_type_aim(m)) { … … 273 273 g_free(temp); 274 274 } else if (owl_message_is_type_loopback(m)) { 275 from=frombuff= owl_strdup("loopback");275 from=frombuff=g_strdup("loopback"); 276 276 } else if (owl_message_is_type_jabber(m)) { 277 277 if (personal) { … … 281 281 } 282 282 } else { 283 from=frombuff= owl_strdup("unknown");283 from=frombuff=g_strdup("unknown"); 284 284 } 285 285 -
message.c
rddbbcffa rd4927a7 47 47 /* save the time */ 48 48 m->time=time(NULL); 49 m->timestr= owl_strdup(ctime(&(m->time)));49 m->timestr=g_strdup(ctime(&(m->time))); 50 50 m->timestr[strlen(m->timestr)-1]='\0'; 51 51 … … 131 131 buff=owl_sprintf(" %-15.15s: %-35.35s\n", owl_pair_get_key(p), "<error>"); 132 132 if(buff == NULL) 133 buff= owl_strdup(" <error>\n");133 buff=g_strdup(" <error>\n"); 134 134 } 135 135 owl_fmtext_append_normal(fm, buff); … … 586 586 cur+=3; 587 587 while (*cur && *cur==' ') cur++; 588 out = owl_strdup(cur);588 out = g_strdup(cur); 589 589 end = strchr(out, '\n'); 590 590 if (end) end[0] = '\0'; … … 609 609 shortuser = short_zuser(user); 610 610 if (strcasecmp(shortuser, recip) != 0) { 611 out = g_list_prepend(out, owl_strdup(user));611 out = g_list_prepend(out, g_strdup(user)); 612 612 } 613 613 g_free(shortuser); … … 795 795 if (m->timestr) g_free(m->timestr); 796 796 m->time=n->z_time.tv_sec; 797 m->timestr= owl_strdup(ctime(&(m->time)));797 m->timestr=g_strdup(ctime(&(m->time))); 798 798 m->timestr[strlen(m->timestr)-1]='\0'; 799 799 -
msgwin.c
rddbbcffa rd4927a7 24 24 void owl_msgwin_set_text(owl_msgwin *msgwin, const char *msg) 25 25 { 26 owl_msgwin_set_text_nocopy(msgwin, owl_strdup(msg));26 owl_msgwin_set_text_nocopy(msgwin, g_strdup(msg)); 27 27 } 28 28 -
owl.c
rddbbcffa rd4927a7 80 80 break; 81 81 case 'c': 82 opts->configfile = owl_strdup(optarg);82 opts->configfile = g_strdup(optarg); 83 83 break; 84 84 case 's': 85 opts->confdir = owl_strdup(optarg);85 opts->confdir = g_strdup(optarg); 86 86 break; 87 87 case 't': 88 opts->tty = owl_strdup(optarg);88 opts->tty = g_strdup(optarg); 89 89 break; 90 90 case 'D': -
perlconfig.c
rddbbcffa rd4927a7 148 148 type = owl_message_get_type(m); 149 149 if(!type || !*type) type = "generic"; 150 utype = owl_strdup(type);150 utype = g_strdup(type); 151 151 utype[0] = toupper(type[0]); 152 152 blessas = owl_sprintf("BarnOwl::Message::%s", utype); … … 214 214 owl_message_set_zwriteline(m, val); 215 215 } else if (!strcmp(key, "time")) { 216 m->timestr = owl_strdup(val);216 m->timestr = g_strdup(val); 217 217 strptime(val, "%a %b %d %T %Y", &tm); 218 218 m->time = mktime(&tm); … … 282 282 283 283 if (srv) { 284 out = owl_strdup(SvPV_nolen(srv));284 out = g_strdup(SvPV_nolen(srv)); 285 285 } else { 286 286 out = NULL; … … 335 335 336 336 if (srv) { 337 out = owl_strdup(SvPV_nolen(srv));337 out = g_strdup(SvPV_nolen(srv)); 338 338 } else { 339 339 out = NULL; … … 369 369 ret=perl_parse(p, owl_perl_xs_init, 2, (char **)args, NULL); 370 370 if (ret || SvTRUE(ERRSV)) { 371 err= owl_strdup(SvPV_nolen(ERRSV));371 err=g_strdup(SvPV_nolen(ERRSV)); 372 372 sv_setsv(ERRSV, &PL_sv_undef); /* and clear the error */ 373 373 return(err); … … 376 376 ret=perl_run(p); 377 377 if (ret || SvTRUE(ERRSV)) { 378 err= owl_strdup(SvPV_nolen(ERRSV));378 err=g_strdup(SvPV_nolen(ERRSV)); 379 379 sv_setsv(ERRSV, &PL_sv_undef); /* and clear the error */ 380 380 return(err); … … 412 412 413 413 if (SvTRUE(ERRSV)) { 414 err= owl_strdup(SvPV_nolen(ERRSV));414 err=g_strdup(SvPV_nolen(ERRSV)); 415 415 sv_setsv (ERRSV, &PL_sv_undef); /* and clear the error */ 416 416 return(err); … … 450 450 } 451 451 452 out = owl_strdup(SvPV(response, len));452 out = g_strdup(SvPV(response, len)); 453 453 FREETMPS; 454 454 LEAVE; … … 529 529 rv = POPs; 530 530 if(SvTRUE(rv)) { 531 ret = owl_strdup(SvPV_nolen(rv));531 ret = g_strdup(SvPV_nolen(rv)); 532 532 } 533 533 } -
regex.c
rddbbcffa rd4927a7 14 14 const char *ptr; 15 15 16 re->string= owl_strdup(string);16 re->string=g_strdup(string); 17 17 18 18 ptr=string; -
select.c
rddbbcffa rd4927a7 23 23 t->destroy = destroy; 24 24 t->data = data; 25 t->name = name ? owl_strdup(name) : NULL;25 t->name = name ? g_strdup(name) : NULL; 26 26 27 27 *timers = g_list_insert_sorted(*timers, t, -
style.c
rddbbcffa rd4927a7 5 5 void owl_style_create_perl(owl_style *s, const char *name, SV *obj) 6 6 { 7 s->name= owl_strdup(name);7 s->name=g_strdup(name); 8 8 s->perlobj = obj; 9 9 } -
text.c
rddbbcffa rd4927a7 193 193 int cur, lastspace, len, lastnewline; 194 194 195 out= owl_strdup(in);195 out=g_strdup(in); 196 196 len=strlen(in); 197 197 cur=0; … … 276 276 int outlen, tolen, fromlen, inpos=0, outpos=0; 277 277 278 if (!*from) return owl_strdup(in);278 if (!*from) return g_strdup(in); 279 279 280 280 outlen = strlen(in)+1; -
util.c
rddbbcffa rd4927a7 292 292 } 293 293 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 301 294 /* allocates memory and returns the string or null. 302 295 * caller must free the string. … … 363 356 364 357 if (getenv("DISPLAY")) { 365 out= owl_strdup(getenv("DISPLAY"));358 out=g_strdup(getenv("DISPLAY")); 366 359 } else if ((tmp=ttyname(fileno(stdout)))!=NULL) { 367 out= owl_strdup(tmp);360 out=g_strdup(tmp); 368 361 if (!strncmp(out, "/dev/", 5)) { 369 362 g_free(out); 370 out= owl_strdup(tmp+5);363 out=g_strdup(tmp+5); 371 364 } 372 365 } else { 373 out= owl_strdup("unknown");366 out=g_strdup("unknown"); 374 367 } 375 368 return(out); … … 384 377 char *tmp, *ptr1, *ptr2, *out; 385 378 386 ptr1=tmp= owl_strdup(in);379 ptr1=tmp=g_strdup(in); 387 380 while (ptr1[0]=='\n') { 388 381 ptr1++; … … 394 387 } 395 388 396 out= owl_strdup(ptr1);389 out=g_strdup(ptr1); 397 390 g_free(tmp); 398 391 return(out); … … 545 538 } 546 539 547 start = owl_strdup(class);540 start = g_strdup(class); 548 541 end = start + strlen(start) - 1; 549 542 while(end > start && *end == 'd' && *(end-1) == '.') { … … 601 594 } 602 595 else { 603 r = owl_strdup("");596 r = g_strdup(""); 604 597 } 605 598 return r; … … 630 623 char *out; 631 624 if (g_utf8_validate(in, -1, NULL)) { 632 out = owl_strdup(in);625 out = g_strdup(in); 633 626 } else { 634 out = owl_strdup("");627 out = g_strdup(""); 635 628 } 636 629 return out; -
variable.c
rddbbcffa rd4927a7 482 482 *cur = *var; 483 483 /* 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); 487 487 switch (cur->type) { 488 488 case OWL_VARIABLE_OTHER: … … 552 552 owl_variable * owl_variable_newvar(const char *name, const char *summary, const char * description) { 553 553 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); 557 557 return var; 558 558 } … … 560 560 void owl_variable_update(owl_variable *var, const char *summary, const char *desc) { 561 561 if(var->summary) g_free(var->summary); 562 var->summary = owl_strdup(summary);562 var->summary = g_strdup(summary); 563 563 if(var->description) g_free(var->description); 564 var->description = owl_strdup(desc);564 var->description = g_strdup(desc); 565 565 } 566 566 … … 570 570 owl_variable_update(old, summ, desc); 571 571 if(old->pval_default) g_free(old->pval_default); 572 old->pval_default = owl_strdup(initval);572 old->pval_default = g_strdup(initval); 573 573 } else { 574 574 owl_variable * var = owl_variable_newvar(name, summ, desc); 575 575 var->type = OWL_VARIABLE_STRING; 576 var->pval_default = owl_strdup(initval);576 var->pval_default = g_strdup(initval); 577 577 var->set_fn = owl_variable_string_set_default; 578 578 var->set_fromstring_fn = owl_variable_string_set_fromstring_default; … … 1009 1009 } 1010 1010 if (v->val) g_free(v->val); 1011 v->val = owl_strdup(newval);1011 v->val = g_strdup(newval); 1012 1012 return(0); 1013 1013 } -
view.c
rddbbcffa rd4927a7 4 4 void owl_view_create(owl_view *v, const char *name, owl_filter *f, const owl_style *s) 5 5 { 6 v->name= owl_strdup(name);6 v->name=g_strdup(name); 7 7 v->filter=f; 8 8 v->style=s; -
zephyr.c
rddbbcffa rd4927a7 23 23 { 24 24 if (input != NULL) 25 return owl_strdup(input);25 return g_strdup(input); 26 26 else 27 27 return owl_sprintf("%s/%s", owl_global_get_homedir(&g), name); … … 292 292 if ((tmp = strtok(start, ",\n\r")) == NULL) 293 293 continue; 294 subs[count].zsub_class = owl_strdup(tmp);294 subs[count].zsub_class = g_strdup(tmp); 295 295 if ((tmp=strtok(NULL, ",\n\r")) == NULL) 296 296 continue; 297 subs[count].zsub_classinst = owl_strdup(tmp);297 subs[count].zsub_classinst = g_strdup(tmp); 298 298 if ((tmp = strtok(NULL, " \t\n\r")) == NULL) 299 299 continue; 300 subs[count].zsub_recipient = owl_strdup(tmp);300 subs[count].zsub_recipient = g_strdup(tmp); 301 301 302 302 /* if it started with '-' then add it to the global punt list, and … … 337 337 count=0; 338 338 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%"); 342 342 count++; 343 343 … … 400 400 } 401 401 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("*"); 404 404 subs[count].zsub_classinst = long_zuser(buffer); 405 405 … … 483 483 /* If there's no message here, just run along now */ 484 484 if (n->z_message_len == 0) 485 return( owl_strdup(""));485 return(g_strdup("")); 486 486 487 487 count=save=0; … … 491 491 if (count==j) { 492 492 /* 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)); 494 494 } else { 495 495 save=i+1; … … 502 502 } 503 503 504 return( owl_strdup(""));504 return(g_strdup("")); 505 505 } 506 506 … … 511 511 /* If there's no message here, just run along now */ 512 512 if (n->z_message_len == 0) 513 return( owl_strdup(""));513 return(g_strdup("")); 514 514 515 515 count=save=0; … … 534 534 } 535 535 536 return( owl_strdup(""));536 return(g_strdup("")); 537 537 } 538 538 #else 539 539 char *owl_zephyr_get_field(void *n, int j) 540 540 { 541 return( owl_strdup(""));541 return(g_strdup("")); 542 542 } 543 543 char *owl_zephyr_get_field_as_utf8(void *n, int j) … … 578 578 /* don't let ping messages have a body */ 579 579 if (!strcasecmp(n->z_opcode, "ping")) { 580 return( owl_strdup(""));580 return(g_strdup("")); 581 581 } 582 582 … … 804 804 805 805 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); 808 808 realm = strchr(retnotice->z_recipient, '@'); 809 809 if(realm) { 810 zw.realm = owl_strdup(realm + 1);810 zw.realm = g_strdup(realm + 1); 811 811 } else { 812 zw.realm = owl_strdup(owl_zephyr_get_realm());812 zw.realm = g_strdup(owl_zephyr_get_realm()); 813 813 } 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(""); 816 816 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)); 818 818 819 819 owl_log_outgoing_zephyr_error(&zw, buff); … … 870 870 to=owl_zephyr_smartstripped_user(owl_message_get_sender(m)); 871 871 } else { 872 to= owl_strdup(owl_message_get_sender(m));872 to=g_strdup(owl_message_get_sender(m)); 873 873 } 874 874 … … 934 934 result = owl_sprintf("%s: Hidden or not logged in\n", myuser); 935 935 } else { 936 result = owl_strdup("");936 result = g_strdup(""); 937 937 for (; numlocs; numlocs--) { 938 938 ZGetLocations(&locations, &one); … … 950 950 return result; 951 951 #else 952 return owl_strdup("");952 return g_strdup(""); 953 953 #endif 954 954 } … … 1132 1132 ret=ZRetrieveSubscriptions(0, &num); 1133 1133 if (ret==ZERR_TOOMANYSUBS) { 1134 return( owl_strdup("Zephyr: too many subscriptions\n"));1134 return(g_strdup("Zephyr: too many subscriptions\n")); 1135 1135 } else if (ret || (num <= 0)) { 1136 return( owl_strdup("Zephyr: error retriving subscriptions\n"));1136 return(g_strdup("Zephyr: error retriving subscriptions\n")); 1137 1137 } 1138 1138 … … 1143 1143 ZFlushSubscriptions(); 1144 1144 g_string_free(buf, true); 1145 return owl_strdup("Error while getting subscriptions\n");1145 return g_strdup("Error while getting subscriptions\n"); 1146 1146 } else { 1147 1147 /* g_string_append_printf would be backwards. */ … … 1158 1158 return g_string_free(buf, false); 1159 1159 #else 1160 return( owl_strdup("Zephyr not available"));1160 return(g_strdup("Zephyr not available")); 1161 1161 #endif 1162 1162 } … … 1185 1185 char *out, *ptr; 1186 1186 1187 out= owl_strdup(in);1187 out=g_strdup(in); 1188 1188 ptr=strchr(out, '@'); 1189 1189 if (ptr) { … … 1201 1201 { 1202 1202 if (strchr(in, '@')) { 1203 return( owl_strdup(in));1203 return(g_strdup(in)); 1204 1204 } 1205 1205 return(owl_sprintf("%s@%s", in, owl_zephyr_get_realm())); … … 1215 1215 char *slash, *dot, *realm, *out; 1216 1216 1217 out = owl_strdup(in);1217 out = g_strdup(in); 1218 1218 1219 1219 /* bail immeaditly if we don't have to do any work */ -
zwrite.c
rddbbcffa rd4927a7 35 35 z->noping=0; 36 36 owl_list_create(&(z->recips)); 37 z->zwriteline = owl_strdup(line);37 z->zwriteline = g_strdup(line); 38 38 39 39 /* parse the command line for options */ … … 46 46 myargc=argc; 47 47 if (myargc && *(myargv[0])!='-') { 48 z->cmd= owl_strdup(myargv[0]);48 z->cmd=g_strdup(myargv[0]); 49 49 myargc--; 50 50 myargv++; … … 137 137 138 138 /* 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(""); 143 143 /* z->message is allowed to stay NULL */ 144 144 … … 178 178 to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm); 179 179 } else { 180 to = owl_strdup(owl_list_get_element(&(z->recips), i));180 to = g_strdup(owl_list_get_element(&(z->recips), i)); 181 181 } 182 182 send_ping(to, z->class, z->inst); … … 203 203 j=owl_list_get_size(&(z->recips)); 204 204 if (j>0 && z->cc) { 205 toline = owl_strdup( "CC: ");205 toline = g_strdup( "CC: "); 206 206 for (i=0; i<j; i++) { 207 207 tmp = toline; … … 252 252 to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm); 253 253 } else { 254 to = owl_strdup( owl_list_get_element(&(z->recips), i));254 to = g_strdup( owl_list_get_element(&(z->recips), i)); 255 255 } 256 256 ret = send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message); … … 319 319 { 320 320 if(z->zsig) g_free(z->zsig); 321 z->zsig = owl_strdup(zsig);321 z->zsig = g_strdup(zsig); 322 322 } 323 323
Note: See TracChangeset
for help on using the changeset viewer.