Changeset f9c43ae for util.c


Ignore:
Timestamp:
Sep 21, 2002, 7:52:22 PM (22 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
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
Message:
Fixed up the normal scrolling code.  Now it should always
  land on a message, but it's still not optimal.
Added the variable 'smartstrip' which will strip kerberos
  instances out for the 'reply' command.
Added -R/usr/athena/lib to the build for Athena
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    r42abb10 rf9c43ae  
    411411}
    412412
     413
    413414char *long_zuser(char *in) {
    414415  char *ptr;
     
    421422  }
    422423}
    423                  
     424
     425
     426char *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}
    424461
    425462char *owl_getquoting(char *line) {
Note: See TracChangeset for help on using the changeset viewer.