/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/org/waxworlds/edam/importcontacts/VCFImporter.java

  • Committer: edam
  • Date: 2011-03-13 18:18:07 UTC
  • Revision ID: edam@waxworlds.org-20110313181807-3smjm2m3bt8hahr8
- check for empty data "values" after parsing line parameters, so that we catch parameter errors (such as unknown encoding types).

Show diffs side-by-side

added added

removed removed

653
653
 
654
654
                private String checkParam( String[] params, String name )
655
655
                {
656
 
                        Pattern p = Pattern.compile(
657
 
                                        "^" + name + "[ \\t]*=[ \\t]*(\"?)(.*)\\1$" );
 
656
                        Pattern p = Pattern.compile( "^" + name + "[ \\t]*=[ \\t]*(.*)$" );
658
657
                        for( int i = 0; i < params.length; i++ ) {
659
658
                                Matcher m = p.matcher( params[ i ] );
660
659
                                if( m.matches() )
661
 
                                        return m.group( 2 );
 
660
                                        return m.group( 1 );
662
661
                        }
663
662
                        return null;
664
663
                }