git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kyle Hayes <kyle@marchex.com>
To: azarah@nosferatu.za.org
Cc: Petr Baudis <pasky@ucw.cz>, GIT Mailing Lists <git@vger.kernel.org>
Subject: Re: [patch] fixup GECOS handling
Date: Fri, 22 Apr 2005 13:46:55 -0700	[thread overview]
Message-ID: <1114202815.31076.444.camel@axer.marchex.com> (raw)
In-Reply-To: <1114196803.29271.52.camel@nosferatu.lan>

On Fri, 2005-04-22 at 21:06 +0200, Martin Schlemmer wrote:
> Right, but ';' is not cutoff on linux for one, and from what you said
> freebsd as well.  How about this rather (note that I assumed that the
> use of ';' as delimiter will be in the minority, but we can switch
> things around if it turns out the other way):

I'm not sure that __aix__ is defined, but it is close enough.  Someone
with an AIX compiler can correct it if needed.  Anyone know about HP-UX
and Tru64 and all those other ones?

Note that the original code also cuts on '.'.  Is that used by some *nix
in GECOS?

Best,
Kyle

> ----
> (not signed off, etc, as just for comments)
> 
> Index: commit-tree.c
> ===================================================================
> --- 5f61aecb06c2f2579bbb5951b1b53e0dedc434eb/commit-tree.c  (mode:100644 sha1:c0b07f89286c3f6cceae8122b4c3142c8efaf8e1)
> +++ uncommitted/commit-tree.c  (mode:100644)
> @@ -96,21 +96,6 @@
>                 if (!c)
>                         break;
>         }
> -
> -       /*
> -        * Go back, and remove crud from the end: some people
> -        * have commas etc in their gecos field
> -        */
> -       dst--;
> -       while (--dst >= p) {
> -               unsigned char c = *dst;
> -               switch (c) {
> -               case ',': case ';': case '.':
> -                       *dst = 0;
> -                       continue;
> -               }
> -               break;
> -       }
>  }
> 
>  static const char *month_names[] = {
> @@ -311,6 +296,17 @@
>         if (!pw)
>                 die("You don't exist. Go away!");
>         realgecos = pw->pw_gecos;
> +       /*
> +        * The GECOS fields are seperated via ',' on Linux, FreeBSD, etc,
> +        * and ';' on AIX.
> +        */
> +#if defined(__aix__)
> +       if (strchr(realgecos, ';'))
> +               *strchr(realgecos, ';') = 0;
> +#else
> +       if (strchr(realgecos, ','))
> +               *strchr(realgecos, ',') = 0;
> +#endif
>         len = strlen(pw->pw_name);
>         memcpy(realemail, pw->pw_name, len);
>         realemail[len] = '@';
> 
> 
-- 
Kyle Hayes <kyle@marchex.com>
Marchex Inc.


  reply	other threads:[~2005-04-22 20:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18 10:36 [patch] fixup GECOS handling Martin Schlemmer
2005-04-18 12:35 ` David Woodhouse
2005-04-18 12:58   ` Martin Schlemmer
2005-04-22 14:23   ` Martin Schlemmer
2005-04-22 16:16     ` Kyle Hayes
2005-04-22 16:58       ` Martin Schlemmer
2005-04-22 17:18         ` Petr Baudis
2005-04-22 17:25           ` Martin Schlemmer
2005-04-22 17:58           ` Kyle Hayes
2005-04-22 19:06             ` Martin Schlemmer
2005-04-22 20:46               ` Kyle Hayes [this message]
2005-04-23 23:38               ` Petr Baudis
2005-04-23 23:49                 ` Martin Schlemmer
2005-04-22 17:43         ` Kyle Hayes
2005-04-22 23:30       ` Andy Isaacson
2005-04-25 17:02         ` Kyle Hayes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1114202815.31076.444.camel@axer.marchex.com \
    --to=kyle@marchex.com \
    --cc=azarah@nosferatu.za.org \
    --cc=git@vger.kernel.org \
    --cc=pasky@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).