Commit ccecd340 authored by Kazuma Furuhashi's avatar Kazuma Furuhashi Committed by Alexander Alekhin

Merge pull request #15007 from 284km:fixatypo

s/last_occurence/last_occurrence/
parent 47007224
...@@ -603,7 +603,7 @@ public: ...@@ -603,7 +603,7 @@ public:
{ {
int xml_buf_size = 1 << 10; int xml_buf_size = 1 << 10;
char substr[] = "</opencv_storage>"; char substr[] = "</opencv_storage>";
int last_occurence = -1; int last_occurrence = -1;
xml_buf_size = MIN(xml_buf_size, int(file_size)); xml_buf_size = MIN(xml_buf_size, int(file_size));
fseek( file, -xml_buf_size, SEEK_END ); fseek( file, -xml_buf_size, SEEK_END );
std::vector<char> xml_buf_(xml_buf_size+2); std::vector<char> xml_buf_(xml_buf_size+2);
...@@ -621,11 +621,11 @@ public: ...@@ -621,11 +621,11 @@ public:
ptr = strstr( ptr, substr ); ptr = strstr( ptr, substr );
if( !ptr ) if( !ptr )
break; break;
last_occurence = line_offset + (int)(ptr - ptr0); last_occurrence = line_offset + (int)(ptr - ptr0);
ptr += strlen(substr); ptr += strlen(substr);
} }
} }
if( last_occurence < 0 ) if( last_occurrence < 0 )
{ {
release(); release();
CV_Error( CV_StsError, "Could not find </opencv_storage> in the end of file.\n" ); CV_Error( CV_StsError, "Could not find </opencv_storage> in the end of file.\n" );
...@@ -633,7 +633,7 @@ public: ...@@ -633,7 +633,7 @@ public:
closeFile(); closeFile();
file = fopen( filename.c_str(), "r+t" ); file = fopen( filename.c_str(), "r+t" );
CV_Assert(file != 0); CV_Assert(file != 0);
fseek( file, last_occurence, SEEK_SET ); fseek( file, last_occurrence, SEEK_SET );
// replace the last "</opencv_storage>" with " <!-- resumed -->", which has the same length // replace the last "</opencv_storage>" with " <!-- resumed -->", which has the same length
puts( " <!-- resumed -->" ); puts( " <!-- resumed -->" );
fseek( file, 0, SEEK_END ); fseek( file, 0, SEEK_END );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment