Compare commits
No commits in common. 'c9' and 'i9c-beta' have entirely different histories.
@ -0,0 +1,26 @@
|
|||||||
|
diff -up less-590/command.c.fix_sast1 less-590/command.c
|
||||||
|
--- less-590/command.c.fix_sast1 2021-06-03 19:45:48.000000000 +0200
|
||||||
|
+++ less-590/command.c 2024-08-06 23:28:58.042048590 +0200
|
||||||
|
@@ -927,8 +927,8 @@ getcc_repl(orig, repl, gr_getc, gr_unget
|
||||||
|
LWCHAR (*gr_getc)(VOID_PARAM);
|
||||||
|
void (*gr_ungetc)(LWCHAR);
|
||||||
|
{
|
||||||
|
- LWCHAR c;
|
||||||
|
- LWCHAR keys[16];
|
||||||
|
+ char c;
|
||||||
|
+ char keys[16];
|
||||||
|
int ki = 0;
|
||||||
|
|
||||||
|
c = (*gr_getc)();
|
||||||
|
diff -up less-590/decode.c.fix_sast1 less-590/decode.c
|
||||||
|
--- less-590/decode.c.fix_sast1 2024-08-06 23:28:58.041048580 +0200
|
||||||
|
+++ less-590/decode.c 2024-08-06 23:29:55.715615701 +0200
|
||||||
|
@@ -934,7 +934,7 @@ add_hometable(call_lesskey, envname, def
|
||||||
|
char *def_filename;
|
||||||
|
int sysvar;
|
||||||
|
{
|
||||||
|
- char *filename;
|
||||||
|
+ char *filename = NULL;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
if (envname != NULL && (filename = lgetenv(envname)) != NULL)
|
@ -0,0 +1,53 @@
|
|||||||
|
diff -up less-590/lesskey_parse.c.fix_sast2 less-590/lesskey_parse.c
|
||||||
|
--- less-590/lesskey_parse.c.fix_sast2 2024-08-06 23:42:33.839079731 +0200
|
||||||
|
+++ less-590/lesskey_parse.c 2024-08-06 23:47:17.433874330 +0200
|
||||||
|
@@ -548,9 +548,9 @@ parse_lesskey(infile, tables)
|
||||||
|
FILE *desc;
|
||||||
|
char line[1024];
|
||||||
|
|
||||||
|
- if (infile == NULL)
|
||||||
|
- infile = homefile(DEF_LESSKEYINFILE);
|
||||||
|
- lesskey_file = infile;
|
||||||
|
+ lesskey_file = (infile != NULL) ? strdup(infile) : homefile(DEF_LESSKEYINFILE);
|
||||||
|
+ if (lesskey_file == NULL)
|
||||||
|
+ return (-1);
|
||||||
|
|
||||||
|
init_tables(tables);
|
||||||
|
errors = 0;
|
||||||
|
@@ -559,22 +559,29 @@ parse_lesskey(infile, tables)
|
||||||
|
/*
|
||||||
|
* Open the input file.
|
||||||
|
*/
|
||||||
|
- if (strcmp(infile, "-") == 0)
|
||||||
|
+ if (strcmp(lesskey_file, "-") == 0)
|
||||||
|
desc = stdin;
|
||||||
|
- else if ((desc = fopen(infile, "r")) == NULL)
|
||||||
|
+ else if ((desc = fopen(lesskey_file, "r")) == NULL)
|
||||||
|
{
|
||||||
|
- /* parse_error("cannot open lesskey file ", infile); */
|
||||||
|
- return (-1);
|
||||||
|
+ /* parse_error("cannot open lesskey file %s", lesskey_file); */
|
||||||
|
+ errors = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read and parse the input file, one line at a time.
|
||||||
|
*/
|
||||||
|
- while (fgets(line, sizeof(line), desc) != NULL)
|
||||||
|
+ if (desc != NULL)
|
||||||
|
{
|
||||||
|
- ++linenum;
|
||||||
|
- parse_line(line, tables);
|
||||||
|
+ while (fgets(line, sizeof(line), desc) != NULL)
|
||||||
|
+ {
|
||||||
|
+ ++linenum;
|
||||||
|
+ parse_line(line, tables);
|
||||||
|
+ }
|
||||||
|
+ if (desc != stdin)
|
||||||
|
+ fclose(desc);
|
||||||
|
}
|
||||||
|
+ free(lesskey_file);
|
||||||
|
+ lesskey_file = NULL;
|
||||||
|
|
||||||
|
return (errors);
|
||||||
|
}
|
Loading…
Reference in new issue