Skip to content

Commit

Permalink
Don't set # in lsystem; lesskey try $HOME first.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Mar 8, 1995
1 parent 5c00c37 commit 0dda0b5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Makefile.o2e
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#### Start of system configuration section. ####

CC = gcc
CFLAGS = -I. -Zomf -O
CC = gcc -Zomf
CFLAGS = -I. -O
LDFLAGS = -s -Zcrtdll -Zstack 512
LIBS = -ltermcap
O = obj
Expand All @@ -16,7 +16,7 @@ O = obj
# This rule allows us to supply the necessary -D options
# in addition to whatever the user asks for.
.c.$(O):
${CC} -c -I. ${CPPFLAGS} ${CFLAGS} $<
${CC} -c ${CPPFLAGS} ${CFLAGS} $<

OBJ = main.$(O) screen.$(O) brac.$(O) ch.$(O) charset.$(O) cmdbuf.$(O) \
command.$(O) decode.$(O) edit.$(O) filename.$(O) forwback.$(O) \
Expand Down
5 changes: 3 additions & 2 deletions edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ edit_ifile(ifile)
{
/*
* No new file to open.
* (Don't set old_ifile, because if you call edit_ifile(NULL),
* you're supposed to have saved curr_ifile yourself,
* and you'll restore it if necessary.)
*/
if (was_curr_ifile != NULL_IFILE)
old_ifile = was_curr_ifile;
return (0);
}

Expand Down
7 changes: 6 additions & 1 deletion filename.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,17 @@ fexpand(s)
switch (*fr)
{
case '%':
if (curr_ifile == NULL_IFILE)
{
/* error("No current file", NULL_PARG); */
return (save(s));
}
n += strlen(get_filename(curr_ifile));
break;
case '#':
if (old_ifile == NULL_IFILE)
{
error("No previous file", NULL_PARG);
/* error("No previous file", NULL_PARG); */
return (save(s));
}
n += strlen(get_filename(old_ifile));
Expand Down
10 changes: 4 additions & 6 deletions lesskey.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,13 @@ homefile(filename)
char *p;
char *pathname;

if ((p = getenv("HOME")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
#if OS2
if ((p = getenv("INIT")) != NULL && *p != '\0')
else if ((p = getenv("INIT")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
else
#endif
if ((p = getenv("HOME")) != NULL && *p != '\0')
{
pathname = mkpathname(p, filename);
} else
else
{
fprintf(stderr, "cannot find $HOME - using current directory\n");
pathname = mkpathname(".", filename);
Expand Down
4 changes: 3 additions & 1 deletion version.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@
* v283: Fix homefile; make OS2 look in $HOME. 3/2/95
* v284: Error if "v" on LESSOPENed file; 3/2/95
* "%" figures out file size on pipe.
* v285: Don't set # in lsystem; 3/7/95
* lesskey try $HOME first.
*/

char version[] = "284";
char version[] = "285";

0 comments on commit 0dda0b5

Please sign in to comment.