mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2025-01-07 17:18:48 +01:00
Minor
This commit is contained in:
parent
bd1eaaf6e0
commit
2b7d50e914
13
ctpv.c
13
ctpv.c
@ -257,8 +257,8 @@ static int list(void)
|
|||||||
|
|
||||||
width_name += 2, width_ext += 2;
|
width_name += 2, width_ext += 2;
|
||||||
|
|
||||||
puts("List of available previews:");
|
puts("List of available previews:\n");
|
||||||
printf("\t%-*s %-*s %s\n", width_name, header_name, width_ext, header_ext,
|
printf("\t%-*s %-*s %s\n\n", width_name, header_name, width_ext, header_ext,
|
||||||
header_mime);
|
header_mime);
|
||||||
|
|
||||||
for (size_t i = 0; i < len; i++) {
|
for (size_t i = 0; i < len; i++) {
|
||||||
@ -281,7 +281,7 @@ static int list(void)
|
|||||||
s);
|
s);
|
||||||
}
|
}
|
||||||
|
|
||||||
puts("\nNote: '" ANY_TYPE "' means that it matches any.");
|
puts("\nNote: '" ANY_TYPE "' means that it matches any.\n");
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -290,6 +290,11 @@ static int mime(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const char *f, *mimetype;
|
const char *f, *mimetype;
|
||||||
|
|
||||||
|
if (argc <= 0) {
|
||||||
|
print_error("files are not specified");
|
||||||
|
return ERR;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < argc; i++) {
|
for (int i = 0; i < argc; i++) {
|
||||||
f = argv[i];
|
f = argv[i];
|
||||||
ERRCHK_RET_OK(check_file(f));
|
ERRCHK_RET_OK(check_file(f));
|
||||||
@ -300,7 +305,7 @@ static int mime(int argc, char *argv[])
|
|||||||
ERRCHK_RET(!mimetype);
|
ERRCHK_RET(!mimetype);
|
||||||
|
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
printf("%s: ", f);
|
printf("%s:\t", f);
|
||||||
|
|
||||||
printf(".%s ", get_ext(f));
|
printf(".%s ", get_ext(f));
|
||||||
puts(mimetype);
|
puts(mimetype);
|
||||||
|
2
error.c
2
error.c
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
void print_error(const char *error_msg)
|
void print_error(const char *error_msg)
|
||||||
{
|
{
|
||||||
|
/* We print errors to stdout because lf file manager
|
||||||
|
* doesn't print stderr in the preview window. */
|
||||||
fprintf(stdout, "%s: %s\n", program, error_msg);
|
fprintf(stdout, "%s: %s\n", program, error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
lexer.h
2
lexer.h
@ -5,7 +5,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define PARSEERROR(c, format, ...) \
|
#define PARSEERROR(c, format, ...) \
|
||||||
print_errorf("config:%u:%u " format, (c).line, \
|
print_errorf("config:%u:%u: " format, (c).line, \
|
||||||
(c).col __VA_OPT__(, ) __VA_ARGS__)
|
(c).col __VA_OPT__(, ) __VA_ARGS__)
|
||||||
|
|
||||||
typedef struct Lexer Lexer;
|
typedef struct Lexer Lexer;
|
||||||
|
Loading…
Reference in New Issue
Block a user