highlight/highlight-3.42-list-available-langs.patch
2023-06-20 17:11:51 +02:00

26 lines
1.2 KiB
Diff

diff -up highlight-3.42/src/core/platform_fs.cpp.list-available-langs highlight-3.42/src/core/platform_fs.cpp
--- highlight-3.42/src/core/platform_fs.cpp.list-available-langs 2019-01-11 12:29:24.887974294 +0100
+++ highlight-3.42/src/core/platform_fs.cpp 2019-01-11 12:30:22.229973501 +0100
@@ -190,7 +190,7 @@ void getFileNames ( const string &direct
if ( errno ) return;
// save the first fileName entry for this recursion
- const unsigned firstEntry = fileName.size();
+ //const unsigned firstEntry = fileName.size();
// save files and sub directories
while ( ( entry = readdir ( dp ) ) != NULL ) {
@@ -222,8 +222,10 @@ void getFileNames ( const string &direct
if ( errno ) return;
// sort the current entries for fileName
- if ( firstEntry < fileName.size() )
- sort ( &fileName[firstEntry], &fileName[fileName.size() ] );
+ // https://gitlab.com/saalen/highlight/issues/84
+ // coredump with GLIBCXX_ASSERTIONS compiler option, use iterators if sort is needed
+ //if ( firstEntry < fileName.size() )
+ // sort ( &fileName[firstEntry], &fileName[fileName.size() ] );
// recurse into sub directories
// if not doing recursive, subDirectory is empty