- Timestamp:
- Sep 21, 2002, 7:52:22 PM (22 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- bde7714
- Parents:
- 1583c90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
util.c
r42abb10 rf9c43ae 411 411 } 412 412 413 413 414 char *long_zuser(char *in) { 414 415 char *ptr; … … 421 422 } 422 423 } 423 424 425 426 char *smartstripped_user(char *in) { 427 /* strip out the instance from a zsender's principal. 428 * Preserves the realm if present. 429 * the caller must free the return */ 430 431 char *ptr, *realm, *out; 432 433 out=owl_strdup(in); 434 435 /* bail immeaditly if we don't have to do any work */ 436 ptr=strchr(in, '.'); 437 if (!strchr(in, '/') && !ptr) { 438 return(out); 439 } 440 if (ptr && strchr(in, '@') && (ptr > strchr(in, '@'))) { 441 return(out); 442 } 443 444 /* remove the realm from ptr, but hold on to it */ 445 realm=strchr(out, '@'); 446 if (realm) realm[0]='\0'; 447 448 /* strip */ 449 ptr=strchr(out, '.'); 450 if (!ptr) ptr=strchr(out, '/'); 451 ptr[0]='\0'; 452 453 /* reattach the realm if we had one */ 454 if (realm) { 455 strcat(out, "@"); 456 strcat(out, realm+1); 457 } 458 459 return(out); 460 } 424 461 425 462 char *owl_getquoting(char *line) {
Note: See TracChangeset
for help on using the changeset viewer.