- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.