Remove some duplicate const specifiers. Newer gcc complains about these, e.g. interactive.c:149:13: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] const char const *delim = "\t\n\f\r\v "; ^~~~~ With the patch applied, the tree compiles cleanly, at least with gcc-7.4.0 and gcc-8.3.0.
Merge branch 'refs/heads/t/doc-improvements' Another topic branch that was cooking for far too long. * refs/heads/t/doc-improvements: Switch from grutatxt to markdown. INSTALL: Link to the gengetopt web page. manual: Fix a whitespace issue. manual: Add example for interactive mode. manual: Add two more examples. manual: Add example query for omitting a directory. manual: Add short option example. manual: Remove pointless "time" prefix. manual: Improve documentation of --output.
create: Make the directory scan more robust. The directory traversal of adu calls adu_opendir() of fd.c for every subdirectory. If this call fails with EACCESS, a warning is printed but the operation continues, ignoring the directory which could not be accessed. Other errors are considered fatal, though, and adu aborts in this case. This patch continues to scan in this case. This is achieved by making all errors from adu_opendir non-fatal. In the error case we print a warning and ignore the directory, but no longer abort. Thanks to Steffen Schmidt for pointing out this flaw.
Abort if neither --database-dir nor --base-dir is given. If --database-dir is not given, adu concatenates the database root directory (which defaults to /var/lib/adu) with the value of the --base-dir argument. However, if --base-dir is not given either, base_dir_arg is NULL, and the concatenated string becomes the result is /var/lib/adu(null), at least on glibc. With this patch applied, adu handles this case more gracefully: it prints an error message and aborts early.
INSTALL: Link to the gengetopt web page. Most people prefer to install the distro package rather than downloading the tarball from the FTP server. This also removes the sentence about a recent version of gengetopt, since there has been no gengetopt release for a while and all moderately recent distros ship the newest version.
manual: Add example for interactive mode. Interactive mode is treated only very briefly in the documentation and the syntax of the set command is not explained at all. This commit adds an adu script that can be fed to adu -I to produce two different output files for the two users under consideration.
manual: Add short option example. While long options are nice for shell scripts, short options are easier to type at the shell prompt, and look more concise in a man page. This commit adds an example command which is equivalent to the previous one but uses short options and combines two options to explain the equivalence. Subsequent examples will only refer to short options.
manual: Improve documentation of --output. The three redirection features of --output are useless for select mode since these redirections can also be created by the shell. This commit adds a paragraph which clarifies this. We use the opportunity to reword the remaining text for the option slightly.
build: Don't remove adu.png on make clean. This was appropriate with the old logo which was generated from a .sk source file. The new logo, however, only exists in png format, so we should never remove it. The adu.sk~ file can also be skipped from the list of files to be removed by make clean.
fd.c: Avoid gcc warning regarding fchdir(). gcc-4.8.4 on Ubuntu-14.04 complains about our use of fchdir(): fd.c:181:9: warning: ignoring return value of ‘fchdir’, declared with attribute warn_unused_result [-Wunused-result] fchdir(*cwd); Silence the warning by introducing a dummy variable. The patch also fixes the indentation of the comment which explains why we ignore the return value here.