mirror of
https://github.com/opencv/opencv.git
synced 2025-06-26 14:20:57 +08:00
Merge pull request #15007 from 284km:fixatypo
s/last_occurence/last_occurrence/
This commit is contained in:
parent
4700722444
commit
ccecd3405a
@ -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:
|
|||||||
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:
|
|||||||
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 );
|
||||||
|
Loading…
Reference in New Issue
Block a user