~ubuntu-branches/ubuntu/utopic/xfsprogs/utopic-proposed

« back to all changes in this revision

Viewing changes to libxcmd/input.c

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2009-05-06 11:29:18 UTC
  • mfrom: (8.1.1 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090506112918-uzoyzcp90rtr8td7
Tags: 3.0.2
New bugfix release

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
 
328
328
/*
329
329
 * Convert from arbitrary user strings into a numeric ID.
330
 
 * If its all numeric, we convert that inplace, else we do
 
330
 * If it's all numeric, we convert that inplace, else we do
331
331
 * the name lookup, and return the found identifier.
332
332
 */
333
333
 
339
339
        prid_t          prid;
340
340
        char            *sp;
341
341
 
 
342
        /*
 
343
         * Allow either a full numeric or a valid projectname, even
 
344
         * if it starts with a digit.
 
345
         */
342
346
        prid = (prid_t)strtoul(project, &sp, 10);
343
 
        if (sp != project)
 
347
        if (*project != '\0' && *sp == '\0')
344
348
                return prid;
345
349
        prj = getprnam(project);
346
350
        if (prj)