Skip to content

Commit

Permalink
Fix compilation for Windows.
Browse files Browse the repository at this point in the history
Remove some unreferenced variables.
  • Loading branch information
gwsw committed Jan 14, 2002
1 parent 7ce1bb9 commit f460ded
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ expand_special_keys(table, len)
repl = special_key_str(fm[1]);
klen = fm[2] & 0377;
fm += klen;
if (repl == NULL || strlen(repl) > klen)
if (repl == NULL || (int) strlen(repl) > klen)
repl = "\377";
while (*repl != '\0')
*to++ = *repl++;
Expand Down
6 changes: 6 additions & 0 deletions defines.ds
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@
*/
#define HAVE_SHELL 0

/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>|&"
#define DEF_METAESCAPE ""

/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
Expand Down
6 changes: 6 additions & 0 deletions defines.o2
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@
*/
#define HAVE_SHELL 0

/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>|&"
#define DEF_METAESCAPE ""

/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
Expand Down
6 changes: 6 additions & 0 deletions defines.wn
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@
*/
#define HAVE_SHELL 0

/*
* Default shell metacharacters and meta-escape character.
*/
#define DEF_METACHARS "; *?\t\n'\"()<>|&"
#define DEF_METAESCAPE ""

/*
* HAVE_DUP is 1 if your system has the dup() call.
*/
Expand Down
27 changes: 6 additions & 21 deletions filename.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ extern char closequote;
shell_unquote(str)
char *str;
{
#if SPACES_IN_FILENAMES
char *name;
char *p;

name = p = (char *) ecalloc(strlen(str), sizeof(char));
name = p = (char *) ecalloc(strlen(str)+1, sizeof(char));
if (*str == openquote)
{
str++;
Expand All @@ -95,9 +94,6 @@ shell_unquote(str)
}
*p = '\0';
return (name);
#else
return (save(str));
#endif
}

/*
Expand All @@ -106,16 +102,12 @@ shell_unquote(str)
public char *
get_meta_escape()
{
#if HAVE_SHELL
char *s;

s = lgetenv("LESSMETAESCAPE");
if (s == NULL)
s = DEF_METAESCAPE;
return (s);
#else
return ("");
#endif
}

/*
Expand All @@ -124,7 +116,6 @@ get_meta_escape()
static char *
metachars()
{
#if HAVE_SHELL
static char *mchars = NULL;

if (mchars == NULL)
Expand All @@ -134,9 +125,6 @@ metachars()
mchars = DEF_METACHARS;
}
return (mchars);
#else
return ("");
#endif
}

/*
Expand All @@ -156,7 +144,6 @@ metachar(c)
shell_quote(s)
char *s;
{
#if HAVE_SHELL
char *p;
char *newstr;
int len;
Expand Down Expand Up @@ -225,9 +212,6 @@ shell_quote(s)
*p = '\0';
}
return (newstr);
#else /* HAVE_SHELL */
return (save(s));
#endif
}

/*
Expand Down Expand Up @@ -677,6 +661,8 @@ lglob(filename)
register char *p;
register int len;
register int n;
char *pathname;
char *qpathname;
DECL_GLOB_NAME(fnd,drive,dir,fname,ext,handle)

GLOB_FIRST_NAME(filename, &fnd, handle);
Expand All @@ -699,7 +685,7 @@ lglob(filename)
if (qpathname != NULL)
{
n = strlen(qpathname);
while (p - gfilename + n >= len)
while (p - gfilename + n + 2 >= len)
{
/*
* No room in current buffer.
Expand All @@ -714,8 +700,9 @@ lglob(filename)
p = gfilename + strlen(gfilename);
}
strcpy(p, qpathname);
p += n;
free(qpathname);
p += n;
*p++ = ' ';
}
} while (GLOB_NEXT_NAME(handle, &fnd) == 0);

Expand Down Expand Up @@ -894,8 +881,6 @@ close_altfile(altfilename, filename, pipefd)
{
#if HAVE_POPEN
char *lessclose;
char *gfilename;
char *galtfilename;
FILE *fd;
char *cmd;

Expand Down
1 change: 0 additions & 1 deletion option.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ optstring(s, p_str, printopt, validchars)
char *validchars;
{
register char *p;
PARG parg;

if (*s == '\0')
{
Expand Down
2 changes: 0 additions & 2 deletions prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ protochar(c, where, iseditproto)
POSITION len;
int n;
IFILE h;
char *s;
char *escs;

switch (c)
{
Expand Down

0 comments on commit f460ded

Please sign in to comment.