Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libHX for openSUSE:Factory checked 
in at 2022-07-06 15:41:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libHX (Old)
 and      /work/SRC/openSUSE:Factory/.libHX.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libHX"

Wed Jul  6 15:41:32 2022 rev:67 rq:986705 version:4.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/libHX/libHX.changes      2022-04-12 
21:43:22.147661150 +0200
+++ /work/SRC/openSUSE:Factory/.libHX.new.1548/libHX.changes    2022-07-06 
15:41:33.542478286 +0200
@@ -1,0 +2,8 @@
+Mon Jun 27 16:48:54 UTC 2022 - Jan Engelhardt <jeng...@inai.de>
+
+- Update to release 4.6
+  * HX_slurp_fd/HX_slurp_file now supports reading from files
+    reporting their own size as 0 (e.g. ttys, /proc special
+    files).
+
+-------------------------------------------------------------------

Old:
----
  libHX-4.5.tar.asc
  libHX-4.5.tar.xz

New:
----
  libHX-4.6.tar.asc
  libHX-4.6.tar.xz

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

Other differences:
------------------
++++++ libHX.spec ++++++
--- /var/tmp/diff_new_pack.uEHocp/_old  2022-07-06 15:41:34.118479134 +0200
+++ /var/tmp/diff_new_pack.uEHocp/_new  2022-07-06 15:41:34.122479140 +0200
@@ -18,7 +18,7 @@
 
 Name:           libHX
 %define lname   libHX32
-Version:        4.5
+Version:        4.6
 Release:        0
 Summary:        Collection of routines for C and C++ programming
 License:        LGPL-2.1-or-later

++++++ libHX-4.5.tar.xz -> libHX-4.6.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libHX-4.5/configure new/libHX-4.6/configure
--- old/libHX-4.5/configure     2022-04-10 14:49:10.262454168 +0200
+++ new/libHX-4.6/configure     2022-06-27 18:47:06.586601524 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for libHX 4.5.
+# Generated by GNU Autoconf 2.71 for libHX 4.6.
 #
 #
 # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -618,8 +618,8 @@
 # Identity of this package.
 PACKAGE_NAME='libHX'
 PACKAGE_TARNAME='libhx'
-PACKAGE_VERSION='4.5'
-PACKAGE_STRING='libHX 4.5'
+PACKAGE_VERSION='4.6'
+PACKAGE_STRING='libHX 4.6'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1375,7 +1375,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libHX 4.5 to adapt to many kinds of systems.
+\`configure' configures libHX 4.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1446,7 +1446,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libHX 4.5:";;
+     short | recursive ) echo "Configuration of libHX 4.6:";;
    esac
   cat <<\_ACEOF
 
@@ -1561,7 +1561,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libHX configure 4.5
+libHX configure 4.6
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2195,7 +2195,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libHX $as_me 4.5, which was
+It was created by libHX $as_me 4.6, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3684,7 +3684,7 @@
 
 # Define the identity of the package.
  PACKAGE='libhx'
- VERSION='4.5'
+ VERSION='4.6'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -18761,7 +18761,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libHX $as_me 4.5, which was
+This file was extended by libHX $as_me 4.6, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18829,7 +18829,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-libHX config.status 4.5
+libHX config.status 4.6
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libHX-4.5/configure.ac new/libHX-4.6/configure.ac
--- old/libHX-4.5/configure.ac  2022-04-10 14:48:44.000000000 +0200
+++ new/libHX-4.6/configure.ac  2022-06-27 16:03:09.000000000 +0200
@@ -1,4 +1,4 @@
-AC_INIT([libHX], [4.5])
+AC_INIT([libHX], [4.6])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libHX-4.5/doc/changelog.rst 
new/libHX-4.6/doc/changelog.rst
--- old/libHX-4.5/doc/changelog.rst     2022-04-10 14:48:44.000000000 +0200
+++ new/libHX-4.6/doc/changelog.rst     2022-06-27 16:03:09.000000000 +0200
@@ -1,3 +1,12 @@
+v4.6 (2022-06-27)
+=================
+
+Enhancements:
+
+* HX_slurp_fd/HX_slurp_file now supports reading from files reporting their
+  own size as 0 (e.g. ttys, /proc special files).
+
+
 v4.5 (2022-04-10)
 =================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libHX-4.5/doc/string_ops.rst 
new/libHX-4.6/doc/string_ops.rst
--- old/libHX-4.5/doc/string_ops.rst    2022-04-10 14:48:44.000000000 +0200
+++ new/libHX-4.6/doc/string_ops.rst    2022-06-27 16:03:09.000000000 +0200
@@ -256,10 +256,10 @@
 
 ``HX_split_inplace``
        Splits the string ``s`` in-place on any characters from the
-       ``delimiters`` string. The array that will be holding the pointers to
-       the substrings will be allocated and needs to be freed by the user,
-       using ``free``(3). The ``fields`` and ``max`` arguments work as with
-       ``HX_split``.
+       ``delimiters`` string. The resulting array will hold pointers to parts
+       of the original string. The array itself needs to be freed by the user,
+       using ``free``(3), the individual elements must not be freed. The
+       ``fields`` and ``max`` arguments work as with ``HX_split``.
 
 ``HX_split_fixed``
        Splits the string ``s`` in-place on any characters from the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libHX-4.5/src/io.c new/libHX-4.6/src/io.c
--- old/libHX-4.5/src/io.c      2022-04-10 14:48:44.000000000 +0200
+++ new/libHX-4.6/src/io.c      2022-06-27 16:03:09.000000000 +0200
@@ -687,6 +687,36 @@
        struct stat sb;
        if (fstat(fd, &sb) < 0)
                return NULL;
+       if (sb.st_size == 0) {
+               /* e.g. ttys (S_ISCHR) or special procfs files */
+               size_t bufsize = 4096, offset = 0;
+               char *buf = malloc(bufsize);
+               if (buf == nullptr)
+                       return nullptr;
+               ssize_t rdret;
+               while ((rdret = read(fd, buf, bufsize - 1 - offset)) > 0) {
+                       offset += rdret;
+                       if (bufsize - offset >= 4095)
+                               /* any value would work, but >=1 is not all 
that efficient */
+                               continue;
+                       if (bufsize > SSIZE_MAX)
+                               /* No more doubling */
+                               break;
+                       bufsize *= 2;
+                       void *nbuf = realloc(buf, bufsize + 1);
+                       if (nbuf == nullptr) {
+                               int se = errno;
+                               free(buf);
+                               errno = se;
+                               return nullptr;
+                       }
+                       buf = nbuf;
+               }
+               buf[offset] = '\0';
+               if (outsize != nullptr)
+                       *outsize = offset;
+               return buf;
+       }
        size_t fsize = sb.st_size; /* may truncate from loff_t to size_t */
        if (fsize == SIZE_MAX)
                --fsize;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libHX-4.5/src/tc-io.c new/libHX-4.6/src/tc-io.c
--- old/libHX-4.5/src/tc-io.c   2022-04-10 14:48:44.000000000 +0200
+++ new/libHX-4.6/src/tc-io.c   2022-06-27 16:03:09.000000000 +0200
@@ -2,9 +2,11 @@
 #include <fcntl.h>
 #include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <libHX/io.h>
+#include "internal.h"
 
 static void sf(void)
 {
@@ -26,14 +28,28 @@
 {
        size_t z;
        char *s = HX_slurp_file("tc-io.c", &z);
+       if (s == nullptr) {
+               fprintf(stderr, "HX_slurp_file: %s\n", strerror(errno));
+               return EXIT_FAILURE;
+       }
        printf("%s\n", s);
        printf("Dumped %zu bytes\n", z);
+       free(s);
+       s = HX_slurp_file("/proc/version", &z);
+       if (s == nullptr) {
+               fprintf(stderr, "HX_slurp_file: %s\n", strerror(errno));
+               return EXIT_FAILURE;
+       }
+       printf(">%s<\n", s);
+       free(s);
 
        sf();
        int ret = HX_copy_file("tc-io.c", "tciocopy.txt", 0);
-       if (ret <= 0)
+       if (ret <= 0) {
                fprintf(stderr, "HX_copy_file: %s\n", strerror(errno));
-       else
+       } else {
                fprintf(stderr, "copy_file ok\n");
+               unlink("tciocopy.txt");
+       }
        return 0;
 }

Reply via email to