Age | Commit message (Collapse) | Author |
|
- Fix a typo "Url" -> "URL".
- Be a bit more clear some overridable functions read from stdin.
- Some small rewording.
|
|
It is used in the examples.
(Do not directly reference iconv to keep some kind of clear reference list)
|
|
It is a caveat while parsing the data in the sfeed(1) program.
Keep it described in the sfeed(1) man page.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Introduced by a code cleanup/refactor in commit
59ba2ed29bcbe67de6e9ee1e7fb18744f7490c22
|
|
|
|
This makes it easier to reuse the code from reading plain-text list of items
from a file and uses a struct urls to keep its state in a cleaner way.
+ some small code-style improvements and reshuffling.
Inspired by a question from NRK by mail about implementing a "read later"
feature.
(A quick local experiment shows it can be done in ~70 lines of added code).
|
|
this check is already done in util.h and is no longer needed after the
`sfeed_curses -> sfeed` merge.
|
|
Write it in a more verbose, clear and C90-style manner.
This workarounds a bug in scc too (reported upstream and will be fixed of
course). All tools in sfeed can now be compiled with minicurses-mode with the
scc compiler and musl libc without any modifications needed.
scc: http://www.simple-cc.org/
|
|
found via codespell
$ codespell --ignore-regex Nd
|
|
|
|
|
|
|
|
Multiple function calls should still be nested in a do { } while(0), but this
is hopefully obvious looking at the other lines.
While testing, gcc with -O0 created the same binary.
clang added a single jmp instruction.
|
|
This was used in commit a58fa45f25da4f18d7b8c1a815884f67b965406f and previous,
but the code for non-interactive process cleanup was later removed, so clearing
the struct is not not needed anymore, because it is unused.
|
|
This should not use the plain-text URL file ($SFEED_URL_FILE).
|
|
In the past there was an ioctl() call in setupterm(), so this include is not
needed anymore.
|
|
|
|
It would mess up the output since the progress bar writes to stderr aswell.
|
|
|
|
|
|
Do not restart the syscall waitpid, explicitly mention not setting SA_RESTART.
|
|
This now handles SIGTERM on sfeed_curses properly while an interactive child program is running.
Test-case program:
https://git.codemadness.org/sfeed_tests/commit/cd4268d4f71b5d7ab0df593d95e70188475d76bb.html
|
|
This is only for plumbing in non-interactive mode in forkexec(), but not piping
content.
Probably obvious what the descriptors are, but also add a few comments to dup2
of the file descriptors (stdin, stdout, stderr).
To reproduce a behaviour:
Plumb script:
#!/bin/sh
dmenu
Then launch it:
SFEED_PLUMB_INTERACTIVE=0 SFEED_PLUMB=thescript sfeed_curses ~/.sfeed/feeds/*
The program now waits on input while in non-interactive mode and only seems to
hang.
After:
The program starts but just has no input passed to it.
|
|
- SIGINT: reword, canceling the line editor is the exception.
- Document the order of signal handling.
- Document interactive and non-interactive behaviour in a separate section and
in more detail.
Remove repetition for each *_INTERACTIVE environment variable.
- Document SIGINT and SIGTERM exit status.
- Typo: "statusbar" -> "status bar".
- Reword a few sentences.
With additional changes and feedback from adc, thanks!
|
|
... and bump the date also.
|
|
From the mdoc(7) extended introduction[0]:
>To output a backslash, use the escape sequence ‘\e’. Never use the
>escape sequence ‘\\’ in any context.
0: https://mandoc.bsd.lv/mdoc/intro/escaping.html
|
|
Noticed by the Debian scanner for typos (typo-in-manual-page):
https://mentors.debian.net/package/sfeed/
|
|
|
|
No functional change intended. Just slightly more clear.
|
|
This makes sure when processes exit they are reaped immediately (instead of
after closing the line editor).
|
|
editor
This allows pasting in the terminal and also doesnt spam mouse events, which
are not useful here.
|
|
Reported by Leon Fisher, thanks!
"Each signal should have its own sig_atomic_t variable if you want to
keep state for all of them independently."
A similar issue was referenced in a OpenBSD tech mailinglist thread:
https://marc.info/?l=openbsd-tech&m=162940120614641&w=2
|
|
|
|
|
|
Keep a bitmask of the received signals and handle them all.
Also handle them in a particular order now.
|
|
- Wait on the exact process id and get its status.
- Handle SIGCHLD explicitly and reap zombie children: ignoring them by using
sigaction(SIGCHLD, &sa, NULL); would be racy in this case because sfeed_curses
has interactive and non-interactive programs.
Note while testing: if the markread program would be slow and in the meantime a
plumb process would exit. This signal is now pending and is a zombie process
until the SIGCHLD signal can be processed. This is fine.
This also fixes a regression from commit
30a70fa2dab1925b0eaea04f67e3f86b360386dd because SIGCHLD was ignored in the
parent for interactive processes aswell. This broke reading the exit status of
the markread program, reproducable by plumbing an item and then trying to mark
it as read (with SFEED_URL_FILE set).
|
|
|
|
|
|
This is not clearly defined by the C99 standard.
Define ctype-like macros to force it to be ASCII / UTF-8 (not extended ASCII or
something like noticed on OpenBSD 3.8).
(In practise modern libc libraries are all ASCII and UTF-8-compatible. Otherwise
this would break many programs)
|
|
It is unspecified if the C locale iscntrl is compatible with ASCII or not.
Noticed when testing on OpenBSD 3.8 which uses extended ASCII and also uses the
C1 range for control-characters. This breaks support with UTF-8.
Reference:
https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_control_codes_for_general_use
C1 table.
Force an own definition of an ASCII-compatible control-character range since
sfeed expects input to be UTF-8 (or converted from iconv) and so output to be
UTF-8 aswell.
|
|
|
|
This is a regression from the introduced change.
Else wait(&status) returned -1 and status was uninitialized.
The status of the returned program in the markread() function is used to
visually show it as read/unread. If the program failed it is assumed the
program could not mark it and so it is visually unchanged.
Just to be sure also initialize status to -1 (which can never happen normally)
since the exitstatus range is 0-255.
https://man.openbsd.org/wait#ERRORS
[ECHILD]: "No status from the terminated child process is available because the calling
process has asked the system to discard such status by ignoring the signal
SIGCHLD or setting the flag SA_NOCLDWAIT for that signal."
|
|
Pedantic change:
Make main more consistent since other functions in it exit too and main is not
supposed to return or used like that.
|
|
Change the example to reload the feeds anyway, even if one of the feeds
(temporarily) failed to update.
|