~sircmpwn/gmni

fix display of message on TOFU_FINGERPRINT_MISMATCH

Previously the message was never displayed to users
leaving them with a simple "Error: certificate is untrusted".

This also fixes the display of line numbers in the message.
jump more than one entry back or forth in history

by giving an optional number to b & f commands.
The default behaviour of b & f commands has not
been changed.
Fix incorrectly missing -g flag

On systems using dsymutil the check for the "-g" flag was failing not
because the compiler didn't provide it but because of `/dev/null`
being used as output file.
Fix OpenBSD compilation errors

Those changes fix the following compilation errors on OpenBSD:

src/tofu.c:128:28: error: format specifies type 'long' but the argument has type
      'time_t' (aka 'long long') [-Werror,-Wformat]
                        "SHA-512", fingerprint, expires);

src/gmnlm.c:341:31: error: missing sentinel in function call
      [-Werror,-Wsentinel]
                execlp("sh", "sh", "-c", cmd);
                                            ^
                                            , NULL
preserve all bytes except spaces when wrapping

When wrapping the new line should not start with a space.
All other bytes must be preserved to avoid breaking unicode chars.

fix for ~sircmpwn/gmni#21
fix premate line wrap

caused by mutlibyte unicode characters.
During column count unicode continuation bytes
are not counted as columns.
Implement <n>| command
d8f08704 — Alexey Yerin 3 months ago
Refactor gmni to use Curl_URL

This also fixes relative redirects.

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
Fix more strncpy bugs in gmnlm and tofu

>From gcc 9.3.0:

error: '__builtin_strncpy' specified bound 4097 equals destination size
[-Werror=stringop-truncation]

Signed-off-by: William Casarin <jb55@jb55.com>
Fix typo in error message.
Fix bug on mkdirs calls

On some systems dirname uses a static string for its return value, so
we were calling mkdirs recursively on a string that was continuosly changing.

A check was also added after the `snprintf` to make sure there's no
information loss since there is no limit to the length of the string
returned by `get_data_pathfmt`.

Closes #48.
gmnlm: fix a few strncpy compile errors on gcc 9.3

In file included from .../include/string.h:495,
                 from src/gmnlm.c:11:
In function ‘strncpy’,
    inlined from ‘do_prompts’ at src/gmnlm.c:627:3:
...glibc-2.31-dev/include/bits/string_fortified.h:106:10:
error: ‘__builtin_strncpy’ specified bound 1024 equals
destination size [-Werror=stringop-truncation]
return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In function ‘strncpy’,
    inlined from ‘do_prompts’ at src/gmnlm.c:612:3:
...glibc-2.31-dev/include/bits/string_fortified.h:106:10:
error: ‘__builtin_strncpy’ specified bound 1024 equals destination size
[-Werror=stringop-truncation]
return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: William Casarin <jb55@jb55.com>
Simplify posix_dirname logic

dirname has two main problems:
1. It could change in place the string that is passed to it.
2. It uses a static string for its return value, so one should copy it
   somewhere else as soon as possible to avoid subsequent calls to
   dirname to corrupt his data (see #48).

We avoid 1. passing a copy of `path` to dirname and 2. copying it's
return value into `dname`.
Remove -D option from install commands

The '-D' option of `install` is not implemented on some systems that
don't use GNU install. Its uses were replaced with `mkdir -p` commands
to eventually provide the missing folders.
Fix install in case of missing docs compilation

Install on systems without `scdoc` was broken because `make install` was
attempting to install missing files.
fix typo in PERMANENT FAILURE response
021d8f8f — Jon Higgs 3 months ago
Improve the -j usage
Check if pkg-config is valid before checking for libs
c036a438 — Connor Kuehl 3 months ago
Initialize result if res != GEMINI_OK

My compiler barks about this unitialized variable:

CC	src/gmnlm.o
src/gmnlm.c:629:7: error: variable 'result' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
                if (res != GEMINI_OK) {
                    ^~~~~~~~~~~~~~~~
src/gmnlm.c:673:9: note: uninitialized use occurs here
        return result;
               ^~~~~~
src/gmnlm.c:629:3: note: remove the 'if' if its condition is always false
                if (res != GEMINI_OK) {
                ^~~~~~~~~~~~~~~~~~~~~~~
src/gmnlm.c:482:2: note: variable 'result' is declared here
        enum prompt_result result;
        ^
1 error generated.
make: *** [src/gmnlm.o] Error 1
514cb373 — Joe Jenne 3 months ago
Fix const comparison Werror
75087ce6 — Cédric Hannotier 3 months ago
{var//pattern/replacement} is not POSIX compliant
Next