~ubuntu-branches/ubuntu/feisty/argtable2/feisty

« back to all changes in this revision

Viewing changes to src/arg_rex.c

  • Committer: Bazaar Package Importer
  • Author(s): Shachar Shemesh
  • Date: 2006-11-14 16:13:36 UTC
  • mfrom: (2.1.1 edgy)
  • Revision ID: james.westby@ubuntu.com-20061114161336-k2z40o650zfi7pjx
Tags: 6-3
* Update maintainer's email address (now a Debian Developer)
* Update the policy version to 3.7.2 (no changes required)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*********************************************************************
2
2
This file is part of the argtable2 library.
3
 
Copyright (C) 1998,1999,2000,2001,2003,2004,2005 Stewart Heitmann
 
3
Copyright (C) 1998-2001,2003-2006 Stewart Heitmann
4
4
sheitmann@users.sourceforge.net
5
5
 
6
6
The argtable2 library is free software; you can redistribute it and/or
61
61
    int errorcode = 0;
62
62
 
63
63
    if (parent->count == parent->hdr.maxcount )
 
64
        {
 
65
        /* maximum number of arguments exceeded */
64
66
        errorcode = EMAXCOUNT;
 
67
        }
 
68
    else if (!argval)
 
69
        {
 
70
        /* a valid argument with no argument value was given. */
 
71
        /* This happens when an optional argument value was invoked. */
 
72
        /* leave parent arguiment value unaltered but still count the argument. */
 
73
        parent->count++;
 
74
        }
65
75
    else 
66
76
        {
67
77
        struct privhdr *priv = (struct privhdr*)parent->hdr.priv;
95
105
    const char *longopts  = parent->hdr.longopts;
96
106
    const char *datatype  = parent->hdr.datatype;
97
107
 
 
108
    /* make argval NULL safe */
 
109
    argval = argval ? argval : "";
 
110
 
98
111
    fprintf(fp,"%s: ",progname);
99
112
    switch(errorcode)
100
113
        {