Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ugrep for openSUSE:Factory checked 
in at 2022-06-29 16:01:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ugrep (Old)
 and      /work/SRC/openSUSE:Factory/.ugrep.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ugrep"

Wed Jun 29 16:01:57 2022 rev:30 rq:985836 version:3.8.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/ugrep/ugrep.changes      2022-06-12 
17:43:10.774488178 +0200
+++ /work/SRC/openSUSE:Factory/.ugrep.new.1548/ugrep.changes    2022-06-29 
16:03:19.972780409 +0200
@@ -1,0 +2,7 @@
+Wed Jun 29 13:06:04 UTC 2022 - Andreas Stieger <andreas.stie...@gmx.de>
+
+- update to 3.8.3:
+  * fix search with tiny lz4 files
+  * skip empty zip files
+
+-------------------------------------------------------------------

Old:
----
  ugrep-3.8.2.tar.gz

New:
----
  ugrep-3.8.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ugrep.spec ++++++
--- /var/tmp/diff_new_pack.iOd73N/_old  2022-06-29 16:03:20.360780926 +0200
+++ /var/tmp/diff_new_pack.iOd73N/_new  2022-06-29 16:03:20.364780932 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           ugrep
-Version:        3.8.2
+Version:        3.8.3
 Release:        0
 Summary:        Universal grep: a feature-rich grep implementation with focus 
on speed
 License:        BSD-3-Clause

++++++ ugrep-3.8.2.tar.gz -> ugrep-3.8.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ugrep-3.8.2/Makefile.am new/ugrep-3.8.3/Makefile.am
--- old/ugrep-3.8.2/Makefile.am 2022-06-10 23:20:46.000000000 +0200
+++ new/ugrep-3.8.3/Makefile.am 2022-06-29 03:13:43.000000000 +0200
@@ -49,17 +49,17 @@
                 echo "|   alias ux     = 'ug -U --hexdump'                   
|"; \
                 echo "|   alias uz     = 'ug -z'                             
|"; \
                 echo "|   alias ugit   = 'ug --ignore-files'                 
|"; \
-                echo "|   alias grep   = 'ugrep -G'                          
|"; \
-                echo "|   alias egrep  = 'ugrep -E'                          
|"; \
-                echo "|   alias fgrep  = 'ugrep -F'                          
|"; \
-                echo "|   alias pgrep  = 'ugrep -P'                          
|"; \
-                echo "|   alias xgrep  = 'ugrep -U --hexdump'                
|"; \
-                echo "|   alias zgrep  = 'ugrep -zG'                         
|"; \
-                echo "|   alias zegrep = 'ugrep -zE'                         
|"; \
-                echo "|   alias zfgrep = 'ugrep -zF'                         
|"; \
-                echo "|   alias zpgrep = 'ugrep -zP'                         
|"; \
-                echo "|   alias zxgrep = 'ugrep -zU --hexdump'               
|"; \
-                echo "|   alias xdump  = 'ugrep -X \"\"'                       
|"; \
+                echo "|   alias grep   = 'ug -G'                             
|"; \
+                echo "|   alias egrep  = 'ug -E'                             
|"; \
+                echo "|   alias fgrep  = 'ug -F'                             
|"; \
+                echo "|   alias pgrep  = 'ug -P'                             
|"; \
+                echo "|   alias xgrep  = 'ug -U --hexdump'                   
|"; \
+                echo "|   alias zgrep  = 'ug -zG'                            
|"; \
+                echo "|   alias zegrep = 'ug -zE'                            
|"; \
+                echo "|   alias zfgrep = 'ug -zF'                            
|"; \
+                echo "|   alias zpgrep = 'ug -zP'                            
|"; \
+                echo "|   alias zxgrep = 'ug -zU --hexdump'                  
|"; \
+                echo "|   alias xdump  = 'ug -X \"\"'                          
|"; \
                 echo "|                                                      
|"; \
                 echo "| Thank you for using ugrep!                           
|"; \
                 echo "|                                                      
|"; \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ugrep-3.8.2/Makefile.in new/ugrep-3.8.3/Makefile.in
--- old/ugrep-3.8.2/Makefile.in 2022-06-10 23:20:46.000000000 +0200
+++ new/ugrep-3.8.3/Makefile.in 2022-06-29 03:13:43.000000000 +0200
@@ -933,17 +933,17 @@
                 echo "|   alias ux     = 'ug -U --hexdump'                   
|"; \
                 echo "|   alias uz     = 'ug -z'                             
|"; \
                 echo "|   alias ugit   = 'ug --ignore-files'                 
|"; \
-                echo "|   alias grep   = 'ugrep -G'                          
|"; \
-                echo "|   alias egrep  = 'ugrep -E'                          
|"; \
-                echo "|   alias fgrep  = 'ugrep -F'                          
|"; \
-                echo "|   alias pgrep  = 'ugrep -P'                          
|"; \
-                echo "|   alias xgrep  = 'ugrep -U --hexdump'                
|"; \
-                echo "|   alias zgrep  = 'ugrep -zG'                         
|"; \
-                echo "|   alias zegrep = 'ugrep -zE'                         
|"; \
-                echo "|   alias zfgrep = 'ugrep -zF'                         
|"; \
-                echo "|   alias zpgrep = 'ugrep -zP'                         
|"; \
-                echo "|   alias zxgrep = 'ugrep -zU --hexdump'               
|"; \
-                echo "|   alias xdump  = 'ugrep -X \"\"'                       
|"; \
+                echo "|   alias grep   = 'ug -G'                             
|"; \
+                echo "|   alias egrep  = 'ug -E'                             
|"; \
+                echo "|   alias fgrep  = 'ug -F'                             
|"; \
+                echo "|   alias pgrep  = 'ug -P'                             
|"; \
+                echo "|   alias xgrep  = 'ug -U --hexdump'                   
|"; \
+                echo "|   alias zgrep  = 'ug -zG'                            
|"; \
+                echo "|   alias zegrep = 'ug -zE'                            
|"; \
+                echo "|   alias zfgrep = 'ug -zF'                            
|"; \
+                echo "|   alias zpgrep = 'ug -zP'                            
|"; \
+                echo "|   alias zxgrep = 'ug -zU --hexdump'                  
|"; \
+                echo "|   alias xdump  = 'ug -X \"\"'                          
|"; \
                 echo "|                                                      
|"; \
                 echo "| Thank you for using ugrep!                           
|"; \
                 echo "|                                                      
|"; \
Binary files old/ugrep-3.8.2/bin/win32/ugrep.exe and 
new/ugrep-3.8.3/bin/win32/ugrep.exe differ
Binary files old/ugrep-3.8.2/bin/win64/ugrep.exe and 
new/ugrep-3.8.3/bin/win64/ugrep.exe differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ugrep-3.8.2/include/reflex/input.h 
new/ugrep-3.8.3/include/reflex/input.h
--- old/ugrep-3.8.2/include/reflex/input.h      2022-06-10 23:20:46.000000000 
+0200
+++ new/ugrep-3.8.3/include/reflex/input.h      2022-06-29 03:13:43.000000000 
+0200
@@ -60,6 +60,10 @@
   a `char*` string, a `wchar_t*` wide string, a `std::string`, a
   `std::wstring`, a `FILE*` descriptor, or a `std::istream` object.
 
+- Strings specified as input must be persistent and cannot be temporary.  The
+  input string contents are incrementally extracted and converted as necessary,
+  when specified with an encoding format `reflex::Input::file_encoding`.
+
 - When assigned a wide string source as input, the wide character content is
   automatically converted to an UTF-8 character sequence when reading with
   get().  Wide strings are UCS-2/UCS-4 and may contain UTF-16 surrogate pairs.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ugrep-3.8.2/src/stats.cpp 
new/ugrep-3.8.3/src/stats.cpp
--- old/ugrep-3.8.2/src/stats.cpp       2022-06-10 23:20:46.000000000 +0200
+++ new/ugrep-3.8.3/src/stats.cpp       2022-06-29 03:13:43.000000000 +0200
@@ -63,8 +63,8 @@
 
   if (fm > 0 && !flag_quiet && !flag_files_with_matches && 
!flag_files_without_match)
   {
-    if (flag_ungroup || (flag_count && flag_only_matching))
-      fprintf(output, "Searched %zu line%s and found %zu matches (ungrouped)" 
NEWLINESTR, sl, (sl == 1 ? "" : "s"), fm);
+    if (flag_ungroup || (flag_count && flag_only_matching) || (!flag_count && 
flag_format != NULL))
+      fprintf(output, "Searched %zu line%s: found %zu matches (ungrouped)" 
NEWLINESTR, sl, (sl == 1 ? "" : "s"), fm);
     else
       fprintf(output, "Searched %zu line%s: %zu matching (%.4g%%)" NEWLINESTR, 
sl, (sl == 1 ? "" : "s"), fm, 100.0 * fm / sl);
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ugrep-3.8.2/src/ugrep.hpp 
new/ugrep-3.8.3/src/ugrep.hpp
--- old/ugrep-3.8.2/src/ugrep.hpp       2022-06-10 23:20:46.000000000 +0200
+++ new/ugrep-3.8.3/src/ugrep.hpp       2022-06-29 03:13:43.000000000 +0200
@@ -38,7 +38,7 @@
 #define UGREP_HPP
 
 // ugrep version
-#define UGREP_VERSION "3.8.2"
+#define UGREP_VERSION "3.8.3"
 
 // disable mmap because mmap is almost always slower than the file reading 
speed improvements since 3.0.0
 #define WITH_NO_MMAP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ugrep-3.8.2/src/zstream.hpp 
new/ugrep-3.8.3/src/zstream.hpp
--- old/ugrep-3.8.2/src/zstream.hpp     2022-06-10 23:20:46.000000000 +0200
+++ new/ugrep-3.8.3/src/zstream.hpp     2022-06-29 03:13:43.000000000 +0200
@@ -169,6 +169,7 @@
     static const uint16_t COMPRESS_HEADER_MAGIC = 0x9d1f;     // compress 
header magic
     static const uint16_t DEFLATE_HEADER_MAGIC  = 0x8b1f;     // zlib deflate 
header magic
     static const uint32_t ZIP_HEADER_MAGIC      = 0x04034b50; // zip local 
file header magic
+    static const uint32_t ZIP_EMPTY_MAGIC       = 0x06054b50; // zip empty 
archive header magic
     static const uint32_t ZIP_DESCRIPTOR_MAGIC  = 0x08074b50; // zip 
descriptor magic
 
     // read zip local file header if we are at a header, read the header, file 
name, and extra field
@@ -1036,9 +1037,11 @@
       catch (const std::bad_alloc&)
       {
         cannot_decompress(pathname_, "out of memory");
+        file_ = NULL;
       }
 #else
       cannot_decompress("unsupported compression format", pathname);
+      file_ = NULL;
 #endif
     }
     else if (is_xz(pathname))
@@ -1062,9 +1065,11 @@
       catch (const std::bad_alloc&)
       {
         cannot_decompress(pathname_, "out of memory");
+        file_ = NULL;
       }
 #else
       cannot_decompress("unsupported compression format", pathname);
+      file_ = NULL;
 #endif
     }
     else if (is_lz4(pathname))
@@ -1079,9 +1084,11 @@
       catch (const std::bad_alloc&)
       {
         cannot_decompress(pathname_, "out of memory");
+        file_ = NULL;
       }
 #else
       cannot_decompress("unsupported compression format", pathname);
+      file_ = NULL;
 #endif
     }
     else if (is_zstd(pathname))
@@ -1096,20 +1103,24 @@
       catch (const std::bad_alloc&)
       {
         cannot_decompress(pathname_, "out of memory");
+        file_ = NULL;
       }
 #else
       cannot_decompress("unsupported compression format", pathname);
+      file_ = NULL;
 #endif
     }
     else if (is_7z(pathname))
     {
       // perhaps 7zip can be supported sometime in the future?
       cannot_decompress("unsupported compression format", pathname);
+      file_ = NULL;
     }
     else if (is_rar(pathname))
     {
       // perhaps RAR can be supported sometime in the future?
       cannot_decompress("unsupported compression format", pathname);
+      file_ = NULL;
     }
     else
     {
@@ -1147,17 +1158,21 @@
           {
             errno = ENOMEM;
             warning("out of memory", pathname);
+            file_ = NULL;
           }
         }
         else if (u16(buf_) == ZipInfo::COMPRESS_HEADER_MAGIC)
         {
           // open compress (Z) compressed file
           if ((zzfile_ = z_open(file, "r", 0, 1)) == NULL)
+          {
             warning("zopen error", pathname);
+            file_ = NULL;
+          }
         }
         else
         {
-          // read two more bytes of the compression format's magic bytes
+          // read two more bytes of the compression format's magic bytes to 
check for zip
           num = fread(buf_ + 2, 1, 2, file);
 
           if (num == 2 && u32(buf_) == ZipInfo::ZIP_HEADER_MAGIC)
@@ -1180,11 +1195,23 @@
             {
               errno = ENOMEM;
               warning("out of memory", pathname);
+              file_ = NULL;
             }
           }
+          else if (num == 2 && u32(buf_) == ZipInfo::ZIP_EMPTY_MAGIC)
+          {
+            // skip empty zip file without warning
+            file_ = NULL;
+          }
+          else if (num == 2 && u32(buf_) == ZipInfo::ZIP_DESCRIPTOR_MAGIC)
+          {
+            // cannot decompress split zip files
+            cannot_decompress(pathname, "spanned zip fragment of a split zip 
archive");
+            file_ = NULL;
+          }
           else if (num >= 0)
           {
-            // no compression
+            // assume no compression
             len_ = num + 2;
             num = fread(buf_ + 4, 1, Z_BUF_LEN - 4, file);
             if (num >= 0)
@@ -1861,7 +1888,7 @@
               }
 
               // skip this skippable frame, then continue with next frame
-              size_t size = u32(lz4file_->zbuf + 4);
+              uint32_t size = u32(lz4file_->zbuf + 4);
               lz4file_->zloc = 8;
               if (lz4file_->zloc + size > lz4file_->zlen)
               {
@@ -1937,7 +1964,7 @@
           }
 
           // get the block size
-          size_t size = u32(lz4file_->zbuf);
+          uint32_t size = u32(lz4file_->zbuf);
           lz4file_->zloc = 4;
 
           if (size == 0)
@@ -1954,6 +1981,11 @@
             continue;
           }
 
+          // if MSB(size) is set then data is uncompressed
+          bool compressed = !(size & 0x80000000);
+          if (!compressed)
+            size &= 0x7fffffff;
+
           // block cannot be larger than the documented max block size of 4MB
           if (size > LZ4::MAX_BLOCK_SIZE)
           {
@@ -1977,20 +2009,32 @@
             break;
           }
 
-          // decompress lz4file_->zbuf[] block into lz4file_->buf[]
-          if (lz4file_->loc >= LZ4::RING_BUFFER_SIZE - LZ4::MAX_BLOCK_SIZE)
-            lz4file_->loc = 0;
-          int ret = LZ4_decompress_safe_continue(lz4file_->strm, 
reinterpret_cast<char*>(lz4file_->zbuf + lz4file_->zloc), 
reinterpret_cast<char*>(lz4file_->buf + lz4file_->loc), size, 
LZ4::MAX_BLOCK_SIZE);
-          lz4file_->zloc += size;
-          if (ret <= 0)
+          if (compressed)
           {
-            cannot_decompress(pathname_, "an error was detected in the lz4 
compressed data");
-            num = -1;
-            break;
+            // decompress lz4file_->zbuf[] block into lz4file_->buf[]
+            if (lz4file_->loc >= LZ4::RING_BUFFER_SIZE - LZ4::MAX_BLOCK_SIZE)
+              lz4file_->loc = 0;
+            int ret = LZ4_decompress_safe_continue(lz4file_->strm, 
reinterpret_cast<char*>(lz4file_->zbuf + lz4file_->zloc), 
reinterpret_cast<char*>(lz4file_->buf + lz4file_->loc), size, 
LZ4::MAX_BLOCK_SIZE);
+            if (ret <= 0)
+            {
+              cannot_decompress(pathname_, "an error was detected in the lz4 
compressed data");
+              num = -1;
+              break;
+            }
+
+            lz4file_->len = lz4file_->loc + ret;
+          }
+          else
+          {
+            // copy uncompressed data into lz4file_->buf[]
+            memcpy(lz4file_->buf + lz4file_->loc, lz4file_->zbuf + 
lz4file_->zloc, size);
+            lz4file_->len = lz4file_->loc + size;
           }
 
-          // copy decompressed data from lz4file_->buf[] into the given buf[]
-          lz4file_->len = lz4file_->loc + ret;
+          // move over processed data
+          lz4file_->zloc += size;
+
+          // copy data from lz4file_->buf[] into the given buf[]
           if (lz4file_->loc + len > lz4file_->len)
             len = lz4file_->len - lz4file_->loc;
           memcpy(buf, lz4file_->buf + lz4file_->loc, len);

Reply via email to