Skip to content
Snippets Groups Projects
  1. Mar 26, 2020
    • c99pedant's avatar
      Quit curl cleanly even if libcurl is old. · 18103982
      c99pedant authored
      Building feh 3.3 on CentOS 7 x86_64 warns `curl_quit_function` in `imlib.c` is unused:
      
      ```
      cc -g -O2 -Wall -Wextra -pedantic -std=c11 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DHAVE_LIBCURL -DHAVE_VERSCMP -DHAVE_LIBXINERAMA -DHAVE_LIBEXIF -DPREFIX=\"/usr/local\" -DPACKAGE=\"feh\" -DVERSION=\"3.3\"   -c -o imlib.o imlib.c
      imlib.c:545:12: warning: ‘curl_quit_function’ defined but not used [-Wunused-function]
       static int curl_quit_function(void *clientp,  curl_off_t dltotal,  curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
                  ^
      ```
      The `curl_quit_function` code was added in response to pull [#435](https://github.com/derf/feh/pull/435)
      
      In issue [#485](https://github.com/derf/feh/issues/485) a fellow CentOS 7 user had an error building feh because CentOS 7 is locked into an old version of libcurl. In the fix, a version guard was wrapped around the `curl_easy_setopt` call, but the rest of the code was unchanged.
      
      Since I don't want to maintain a local build of libcurl, I looked at the curl docs and noticed there is an older callback which serves the same purpose: https://curl.haxx.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html
      
      The difference between `PROGRESS` and `XFERINFO` is the callback's argument types, with `PROGRESS` using `double` and `XFERINFO` using `curl_off_t`: https://curl.haxx.se/libcurl/c/CURLOPT_XFERINFOFUNCTION.html
      
      The callback's return value logic and use of `CURLOPT_NOPROGRESS` is the same.
      
      For context, the latest libcurl RPM I'm getting from yum updates is `libcurl-7.29.0-54.el7_7.2.x86_64`. The "stable" versions of other distros may encounter similar issues. The CentOS 7 "End of Life" date is 2024-06-30 so you should hear the end of this by then, at least from us pesky CentOS users.
      18103982
  2. Jan 24, 2020
  3. Nov 07, 2019
  4. Oct 30, 2019
  5. Oct 11, 2019
  6. Jul 22, 2019
  7. Jul 12, 2019
    • Tobias Stoeckmann's avatar
      Check stat for error before setting permissions. · 2c38c9da
      Tobias Stoeckmann authored
      
      When setting wallpapers without --no-fehbg option, a ~/.fehbg file is
      created. This file is set to be an executable for later re-use.
      
      Calling stat() without checking the return value can lead to issues.
      If the call fails, then s.st_mode is undefined and excessive permissions
      could be set to .fehbg, at worst even setuid/setgid bits for a world
      writable file.
      
      While adjusting this, I changed the code to use fstat() and fchmod() to
      avoid a further -- but very unlikely -- issue: race condition in form of
      TOCTOU. If the file ~/.fehsetbg is replaced by a symlink right before
      the chmod call, then a different file would be set executable + the
      default mode of the (newly created) file. I don't expect this to be a
      real world issue but changed this part "while at it" anyway for more
      robust code and a good example on how to handle files.
      
      Signed-off-by: default avatarTobias Stoeckmann <tobias@stoeckmann.org>
      2c38c9da
  8. Jul 08, 2019
  9. Apr 18, 2019
  10. Apr 12, 2019
  11. Apr 05, 2019
  12. Mar 26, 2019
  13. Mar 15, 2019
  14. Mar 14, 2019
  15. Feb 14, 2019
  16. Feb 11, 2019
  17. Feb 08, 2019
  18. Feb 01, 2019
  19. Jan 21, 2019
    • guraga's avatar
      Update "src/signals.h" · fa10dc1e
      guraga authored
      Use "extern volatile" instead of "volatile extern" to avoid "gcc" warning "'extern' is not at beginning of declaration [-Wold-style-declaration]".
      fa10dc1e
  20. Dec 23, 2018
  21. Dec 22, 2018
  22. Dec 04, 2018
  23. Nov 29, 2018
  24. Nov 23, 2018
  25. Nov 19, 2018
    • Birte Kristina Friesel's avatar
      --start-at: Auto-load directory when no other files are specified · 391a9bfd
      Birte Kristina Friesel authored
      This changes the behaviour of "feh --start-at FILENAME" as follows:
      
      Previously, this would cause feh to load all files in the current
      working directory, since no files or filelists were specified on the command
      line.
      
      Now this is a special case: feh will extract the directory component from
      FILENAME, load all files in that directory, and display FILENAME.
      This way, it's possible to use "feh --start-at ~%f" in XDG Desktop files
      and browse files in feh using the prev/next keys
      
      Closes #372
      Closes #420
      391a9bfd
  26. Nov 18, 2018
  27. Nov 09, 2018
  28. Nov 08, 2018
  29. Nov 05, 2018
  30. Nov 04, 2018
Loading