diff options
author | Gregor Hartmann <gh@openoffice.org> | 2001-11-30 14:03:13 +0000 |
---|---|---|
committer | Gregor Hartmann <gh@openoffice.org> | 2001-11-30 14:03:13 +0000 |
commit | 9d9225430936b4a9011066308030977f6ca2b265 (patch) | |
tree | 56d1e76df9971b0f69b41fa21f943adadc21b4f9 /tools/source/communi | |
parent | 9195b42f22c21cacf8496a84f9f4f57c6f534425 (diff) |
handle corupted files
Diffstat (limited to 'tools/source/communi')
-rw-r--r-- | tools/source/communi/parser.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tools/source/communi/parser.cxx b/tools/source/communi/parser.cxx index 12728443b6d0..60546393c25e 100644 --- a/tools/source/communi/parser.cxx +++ b/tools/source/communi/parser.cxx @@ -2,9 +2,9 @@ * * $RCSfile: parser.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: nf $ $Date: 2001-05-07 14:31:30 $ + * last change: $Author: gh $ $Date: 2001-11-30 15:03:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -135,6 +135,16 @@ ByteString &InformationParser::ReadLine() } } } + else { + if ( nLevel ) { + sLine = "}"; + fprintf( stdout, "Reached EOF parsing %s. Suplying extra '}'\n",ByteString( sStreamName, gsl_getSystemTextEncoding()).GetBuffer() ); + // nErrorCode = IP_UNEXPECTED_EOF; + // nErrorLine = nActLine; + } + else + sLine = ""; + } sOldLine = sLine; nActLine++; @@ -215,8 +225,11 @@ GenericInformation *InformationParser::ReadKey( } else { Recover(); - pInfo = new GenericInformation( sKey, sValue, pExistingList ); - pInfo->SetComment( sComment ); + if ( !sKey.Equals( "}" ) && !sKey.Equals( "{" ) ) + { + pInfo = new GenericInformation( sKey, sValue, pExistingList ); + pInfo->SetComment( sComment ); + } } return pInfo; |