IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6476


Ignore:
Timestamp:
Feb 23, 2006, 5:19:28 PM (20 years ago)
Author:
jhoblitt
Message:

check for # inside fields

Location:
trunk/DataStore/lib/DataStore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/lib/DataStore/File/Parser.pm

    r6475 r6476  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: Parser.pm,v 1.1 2006-02-24 03:14:29 jhoblitt Exp $
     3# $Id: Parser.pm,v 1.2 2006-02-24 03:19:28 jhoblitt Exp $
    44
    55package DataStore::File::Parser;
     
    9595
    9696        # at least fileid, bytes, md5sum, and type fields are required
    97 
    9897        if (scalar @fields < 4) {
    9998            carp "line $lineno: not enough fields: $line";
    10099            next LINE;
     100        }
     101
     102        # fields are not allowed to contain #
     103        foreach my $field (@fields) {
     104            if ($field =~ /\#/) {
     105                carp "line $lineno: field $field: contains #: $line";
     106                next LINE;
     107            }
    101108        }
    102109
  • trunk/DataStore/lib/DataStore/FileSet/Parser.pm

    r6474 r6476  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: Parser.pm,v 1.2 2006-02-24 02:51:31 jhoblitt Exp $
     3# $Id: Parser.pm,v 1.3 2006-02-24 03:19:28 jhoblitt Exp $
    44
    55package DataStore::FileSet::Parser;
     
    102102        }
    103103
     104        # fields are not allowed to contain #
     105        foreach my $field (@fields) {
     106            if ($field =~ /\#/) {
     107                carp "line $lineno: field $field: contains #: $line";
     108                next LINE;
     109            }
     110        }
     111
    104112        my ($fileset, $datetime, $type) = @fields;
    105113
Note: See TracChangeset for help on using the changeset viewer.