/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/am/ed/importcontacts/VcardImporter.java

  • Committer: Tim Marston
  • Date: 2013-05-10 12:05:10 UTC
  • Revision ID: tim@ed.am-20130510120510-xmjdrd7c7gje5shl
make checks for BEGIN:VCARD and END:VCARD case insensitive

Show diffs side-by-side

added added

removed removed

136
136
                                if( !in_vcard )
137
137
                                {
138
138
                                        // look for vcard beginning
139
 
                                        if( line.matches( "^BEGIN[ \t]*:[ \t]*VCARD.*$" ) ) {
 
139
                                        if( line.matches( "(?i)BEGIN[ \t]*:[ \t]*VCARD.*" ) ) {
140
140
                                                in_vcard = true;
141
141
                                                _vcard_count++;
142
142
                                        }
143
143
                                        // check for vMsg files
144
 
                                        else if( line.matches( "^BEGIN[ \t]*:[ \t]*VMSG.*$" ) ) {
 
144
                                        else if( line.matches( "(?i)BEGIN[ \t]*:[ \t]*VMSG.*" ) ) {
145
145
                                                showError( getText( R.string.error_vcf_vmsgfile )
146
146
                                                        + file.getName() );
147
147
                                        }
148
148
                                }
149
 
                                else if( line.matches( "^END[ \t]*:[ \t]*VCARD.*$" ) )
 
149
                                else if( line.matches( "(?i)END[ \t]*:[ \t]*VCARD.*" ) )
150
150
                                        in_vcard = false;
151
151
                        }
152
152
 
209
209
 
210
210
                        if( vcard == null ) {
211
211
                                // look for vcard beginning
212
 
                                if( line.matches( "^BEGIN[ \t]*:[ \t]*VCARD.*$" ) ) {
 
212
                                if( line.matches( "(?i)BEGIN[ \t]*:[ \t]*VCARD.*" ) ) {
213
213
                                        setProgress( _progress++ );
214
214
                                        vcard = new Vcard();
215
215
                                        vcard_start_line = cli.getLineNumber();
217
217
                        }
218
218
                        else {
219
219
                                // look for vcard content or ending
220
 
                                if( line.matches( "^END[ \t]*:[ \t]*VCARD.*$" ) )
 
220
                                if( line.matches( "(?i)END[ \t]*:[ \t]*VCARD.*" ) )
221
221
                                {
222
222
                                        // finalise the vcard/contact
223
223
                                        try {