/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:58:52 UTC
  • Revision ID: edam@waxworlds.org-20110313185852-s74kvkbv8k0v0lwc
- accept parameters that are quoted (this doesn't appear to be part of the standards AFAICT, but Evolution apparently quotes parameter values)

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( "^" + name + "[ \\t]*=[ \\t]*(.*)$" );
 
656
                        Pattern p = Pattern.compile(
 
657
                                        "^" + name + "[ \\t]*=[ \\t]*(\"?)(.*)\\1$" );
657
658
                        for( int i = 0; i < params.length; i++ ) {
658
659
                                Matcher m = p.matcher( params[ i ] );
659
660
                                if( m.matches() )
660
 
                                        return m.group( 1 );
 
661
                                        return m.group( 2 );
661
662
                        }
662
663
                        return null;
663
664
                }