aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-11-23 11:22:26 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1998-11-23 11:22:26 -0500
commite87f21b4ae754e738cbb577215a039a26e28ad52 (patch)
tree40cb2927aab0c440847fa74ff48bb6e0eab9a872 /src
parent8da648ea48792ba4d8714759c557eb7c0f138b0d (diff)
downloadlynx-snapshots-e87f21b4ae754e738cbb577215a039a26e28ad52.tar.gz
snapshot of project "lynx", label v2-8-2dev_7
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c4
-rw-r--r--src/LYLocal.c11
-rw-r--r--src/LYShowInfo.c23
-rw-r--r--src/LYStrings.c5
-rw-r--r--src/LYUtils.c29
5 files changed, 47 insertions, 25 deletions
diff --git a/src/GridText.c b/src/GridText.c
index e43e1ec5..500210f7 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -4090,11 +4090,11 @@ PUBLIC void HText_pageDisplay ARGS2(
int, line_num,
char *, target)
{
+#ifdef DISP_PARTIAL
if (debug_display_partial || (LYTraceLogFP != NULL)) {
CTRACE(tfp, "GridText: HText_pageDisplay at line %d started\n", line_num);
}
-#ifdef DISP_PARTIAL
if (display_partial && detected_forms_input_partial) {
/*
** Garbage is reported from forms input fields in incremental mode.
@@ -4119,9 +4119,11 @@ PUBLIC void HText_pageDisplay ARGS2(
is_www_index = HTAnchor_isIndex(HTMainAnchor);
+#ifdef DISP_PARTIAL
if (debug_display_partial || (LYTraceLogFP != NULL)) {
CTRACE(tfp, "GridText: HText_pageDisplay finished\n");
}
+#endif
}
/*
diff --git a/src/LYLocal.c b/src/LYLocal.c
index 80ec1211..6d12f738 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -29,6 +29,7 @@
*/
#include <HTUtils.h>
+#include <HTAAProt.h>
#include <HTFile.h>
#include <HTAlert.h>
#include <HTParse.h>
@@ -48,7 +49,6 @@
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
-#include <grp.h>
#endif /*_WINDOWS */
#endif /* VMS */
@@ -1067,7 +1067,6 @@ PRIVATE BOOLEAN permit_location ARGS3(
FILE *fp0;
char local_src[LY_MAXPATH];
char * user_filename;
- struct group * grp;
char * group_name;
cp = HTfullURL_toFile(strip_trailing_slash(srcpath));
@@ -1095,13 +1094,7 @@ PRIVATE BOOLEAN permit_location ARGS3(
LYLocalFileToURL(newpath, tempfile);
strcpy(LYPermitFileURL, *newpath);
- grp = getgrgid(dir_info.st_gid);
- if (grp == NULL) {
- group_name = "";
- } else {
- group_name = grp->gr_name;
- }
-
+ group_name = HTAA_GidToName (dir_info.st_gid);
LYstrncpy(LYValidPermitFile,
local_src,
(sizeof(LYValidPermitFile) - 1));
diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c
index 3d3d9c42..d718eb0e 100644
--- a/src/LYShowInfo.c
+++ b/src/LYShowInfo.c
@@ -17,8 +17,7 @@
#include <LYLeaks.h>
#ifdef DIRED_SUPPORT
-#include <pwd.h>
-#include <grp.h>
+#include <HTAAProt.h>
#include <time.h>
#include <LYLocal.h>
#endif /* DIRED_SUPPORT */
@@ -26,7 +25,10 @@
#if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_INFO)
#define HAVE_CFG_DEFS_H
-#define PutDefs(table, N) fprintf(fp0, "%-35s %s\n", table[N].name, table[N].value)
+#define PutDefs(table, N) \
+ fprintf(fp0, "%-35s %s\n", \
+ table[N].name, \
+ (table[N].value != 0) ? table[N].value : "")
/*
* Compile-time definitions info, returns local url
@@ -88,13 +90,12 @@ PUBLIC int showinfo ARGS4(
int url_type;
FILE *fp0;
char *Address = NULL, *Title = NULL;
+ char *name;
CONST char *cp;
#ifdef DIRED_SUPPORT
char temp[LY_MAXPATH];
struct stat dir_info;
- struct passwd *pw;
- struct group *grp;
#endif /* DIRED_SUPPORT */
LYRemoveTemp(tempfile);
@@ -198,12 +199,12 @@ PUBLIC int showinfo ARGS4(
fprintf(fp0, " <em>%s</em> %s\n", gettext("Points to file:"), buf);
}
#endif
- pw = getpwuid(dir_info.st_uid);
- if (pw)
- fprintf(fp0, " <em>%s</em> %s\n", gettext("Name of owner"), pw->pw_name);
- grp = getgrgid(dir_info.st_gid);
- if (grp && grp->gr_name)
- fprintf(fp0, " <em>%s</em> %s\n", gettext("Group name:"), grp->gr_name);
+ name = HTAA_UidToName(dir_info.st_uid);
+ if (*name)
+ fprintf(fp0, " <em>%s</em> %s\n", gettext("Name of owner"), name);
+ name = HTAA_GidToName (dir_info.st_gid);
+ if (*name)
+ fprintf(fp0, " <em>%s</em> %s\n", gettext("Group name:"), name);
if (S_ISREG(dir_info.st_mode)) {
fprintf(fp0, " <em>%s</em> %ld (bytes)\n",
gettext("File size:"), (long)dir_info.st_size);
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 4f88b003..7505f20e 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1050,6 +1050,11 @@ re_read:
case KEY_C3: /* lower right of keypad */
c = PGDOWN;
break;
+#ifdef KEY_ENTER
+ case KEY_ENTER: /* enter/return */
+ c = '\n';
+ break;
+#endif /* KEY_END */
#ifdef KEY_END
case KEY_END: /* end key 001 */
c = END_KEY;
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 0147188e..eb9ed2c5 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -2038,6 +2038,27 @@ PUBLIC void LYFakeZap ARGS1(
}
+PRIVATE int DontCheck NOARGS
+{
+ static time_t last;
+ time_t next;
+
+ /** Curses or slang setup was not invoked **/
+ if (dump_output_immediately)
+ return(TRUE);
+
+ /*
+ * Avoid checking interrupts more than one per second, since it is a slow
+ * and expensive operation - TD
+ */
+ next = time((time_t*)0);
+ if (next == last)
+ return (TRUE);
+
+ last = next;
+ return FALSE;
+}
+
PUBLIC int HTCheckForInterrupt NOARGS
{
int c;
@@ -2057,7 +2078,7 @@ PUBLIC int HTCheckForInterrupt NOARGS
}
/** Curses or slang setup was not invoked **/
- if (dump_output_immediately)
+ if (DontCheck())
return((int)FALSE);
#ifdef USE_SLANG
@@ -2118,7 +2139,7 @@ PUBLIC int HTCheckForInterrupt NOARGS
}
/** Curses or slang setup was not invoked **/
- if (dump_output_immediately)
+ if (DontCheck())
return((int)FALSE);
/** Control-C or Control-Y and a 'N'o reply to exit query **/
@@ -4257,7 +4278,7 @@ PUBLIC BOOLEAN LYExpandHostForURL ARGS3(
FREE(MsgStr);
return GotHost;
#ifndef DJGPP
- } else if (LYCursesON && ((hoststat == HT_INTERRUPTED) || HTCheckForInterrupt())) {
+ } else if (LYCursesON && (hoststat == HT_INTERRUPTED)) {
#else /* DJGPP */
} else if (LYCursesON && HTCheckForInterrupt()) {
#endif /* DJGPP */
@@ -4369,7 +4390,7 @@ PUBLIC BOOLEAN LYExpandHostForURL ARGS3(
* Give the user chance to interrupt lookup cycles. - KW
*/
#ifndef DJGPP
- if (LYCursesON && ((hoststat == HT_INTERRUPTED) || HTCheckForInterrupt()))
+ if (LYCursesON && (hoststat == HT_INTERRUPTED))
#else /* DJGPP */
if (LYCursesON && HTCheckForInterrupt())
#endif /* DJGPP */