~ubuntu-branches/ubuntu/trusty/argtable2/trusty

« back to all changes in this revision

Viewing changes to src/arg_file.c

  • Committer: Bazaar Package Importer
  • Author(s): Shachar Shemesh
  • Date: 2008-05-07 19:54:52 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080507195452-30nwhoptl33nxbfi
Tags: 9-1
New upstream version.

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-2001,2003-2007 Stewart Heitmann
 
3
Copyright (C) 1998-2001,2003-2008 Stewart Heitmann
4
4
sheitmann@users.sourceforge.net
5
5
 
6
6
The argtable2 library is free software; you can redistribute it and/or
177
177
    result = (struct arg_file*)malloc(nbytes);
178
178
    if (result)
179
179
        {
 
180
        int i;
 
181
 
180
182
        /* init the arg_hdr struct */
181
183
        result->hdr.flag      = ARG_HASVALUE;
182
184
        result->hdr.shortopts = shortopts;
196
198
        result->basename  = result->filename + maxcount;
197
199
        result->extension = result->basename + maxcount;
198
200
        result->count = 0;
 
201
 
 
202
        /* foolproof the string pointers by initialising them with empty strings */
 
203
        for (i=0; i<maxcount; i++)
 
204
            {
 
205
            result->filename[i] = "";
 
206
            result->basename[i] = "";
 
207
            result->extension[i] = "";
 
208
            }
199
209
        }
200
210
    /*printf("arg_filen() returns %p\n",result);*/
201
211
    return result;