diff options
| author | Thomas E. Dickey <dickey@invisible-island.net> | 1999-05-08 17:58:27 -0400 |
|---|---|---|
| committer | Thomas E. Dickey <dickey@invisible-island.net> | 1999-05-08 17:58:27 -0400 |
| commit | 169e8098be76947e6e1aa002052d9536dc9aa273 (patch) | |
| tree | a9a81460d41a2d7485184d8ffc423ac9869f2432 /src | |
| parent | 3a66727fc66003224d7c99d15a12f04fdf706ff4 (diff) | |
| download | lynx-snapshots-169e8098be76947e6e1aa002052d9536dc9aa273.tar.gz | |
snapshot of project "lynx", label v2-8-2pre_2
Diffstat (limited to 'src')
| -rw-r--r-- | src/LYBookmark.c | 1 | ||||
| -rw-r--r-- | src/LYCookie.c | 1 | ||||
| -rw-r--r-- | src/LYDownload.c | 2 | ||||
| -rw-r--r-- | src/LYLocal.c | 2 | ||||
| -rw-r--r-- | src/LYReadCFG.c | 15 | ||||
| -rw-r--r-- | src/LYTraversal.c | 21 | ||||
| -rw-r--r-- | src/LYUtils.c | 6 | ||||
| -rw-r--r-- | src/chrtrans/makefile.in | 6 | ||||
| -rw-r--r-- | src/makefile.in | 5 |
9 files changed, 31 insertions, 28 deletions
diff --git a/src/LYBookmark.c b/src/LYBookmark.c index 23b79884..5c4de52e 100644 --- a/src/LYBookmark.c +++ b/src/LYBookmark.c @@ -317,6 +317,7 @@ PUBLIC void save_bookmark_link ARGS2( if ((fp = fopen(filename_buffer, (first_time ? "w" : "a+"))) == NULL) { LYMBM_statusline(BOOKMARK_OPEN_FAILED); sleep(AlertSecs); + FREE(Title); FREE(bookmark_URL); return; } diff --git a/src/LYCookie.c b/src/LYCookie.c index ee5a570e..a4ede1d3 100644 --- a/src/LYCookie.c +++ b/src/LYCookie.c @@ -2449,6 +2449,7 @@ Delete_all_cookies_in_domain: sleep(MessageSecs); } FREE(domain); + FREE(lynxID); return(HT_NO_DATA); } diff --git a/src/LYDownload.c b/src/LYDownload.c index 82860707..eaf1690b 100644 --- a/src/LYDownload.c +++ b/src/LYDownload.c @@ -299,7 +299,7 @@ check_recall: if (HTCountCommandArgs(download_command->command) >= 2) { _statusline(FILENAME_PROMPT); again: if (sug_file) - strncpy(buffer, sug_file, sizeof(buffer)); + strncpy(buffer, sug_file, (sizeof(buffer)/2) - 1); else *buffer = '\0'; check_again: diff --git a/src/LYLocal.c b/src/LYLocal.c index 03138509..1b41f350 100644 --- a/src/LYLocal.c +++ b/src/LYLocal.c @@ -614,7 +614,6 @@ PRIVATE BOOLEAN modify_name ARGS1( PRIVATE BOOLEAN modify_location ARGS1( char *, testpath) { - int mode; char *cp; dev_t dev; ino_t inode; @@ -674,7 +673,6 @@ PRIVATE BOOLEAN modify_location ARGS1( * Make sure the source and target have the same owner (uid). */ dev = dir_info.st_dev; - mode = dir_info.st_mode; inode = dir_info.st_ino; owner = dir_info.st_uid; if (!ok_stat(newpath, &dir_info)) { diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index d85edeb5..6855fa0d 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -617,7 +617,7 @@ static int jumpfile_fun ARGS1( HTSprintf0 (&buffer, "JUMPFILE:%s", value); if (!LYJumpInit(buffer)) CTRACE(tfp, "Failed to register %s\n", buffer); - free(buffer); + FREE(buffer); return 0; } @@ -1503,11 +1503,12 @@ PRIVATE void do_read_cfg ARGS5( } #ifndef NO_CONFIG_INFO - /*now list the opts that are allowed in included file. If all opts - are allowed, then emit nothing, else emit an effective set of - allowed options in <ul>. Option names will be and uppercased. - FIXME: uppercasing option names can be considered redundant. */ - + /* + * Now list the opts that are allowed in included file. If all + * opts are allowed, then emit nothing, else emit an effective set + * of allowed options in <ul>. Option names will be uppercased. + * FIXME: uppercasing option names can be considered redundant. + */ if (fp0 != 0 && !LYRestricted && resultant_set) { char *buf = NULL; unsigned i; @@ -1520,7 +1521,7 @@ PRIVATE void do_read_cfg ARGS5( LYUpperCase(buf); fprintf(fp0," * %s\n", buf); } - free(buf); + FREE(buf); } #endif do_read_cfg (value, cfg_filename, nesting_level + 1, fp0,resultant_set); diff --git a/src/LYTraversal.c b/src/LYTraversal.c index afa4d289..04c18154 100644 --- a/src/LYTraversal.c +++ b/src/LYTraversal.c @@ -141,8 +141,7 @@ PUBLIC BOOLEAN lookup_reject ARGS1(char *,target) FILE *ifp; char *buffer = NULL; char *line = NULL; - char ch; - int frag; + int len; int result = FALSE; if ((ifp = fopen(TRAVERSE_REJECT_FILE,"r")) == NULL){ @@ -152,20 +151,20 @@ PUBLIC BOOLEAN lookup_reject ARGS1(char *,target) HTSprintf0(&line, "%s\n", target); while (LYSafeGets(&buffer, ifp) != NULL && !result) { - frag = strlen(buffer) - 1; /* real length, minus trailing null */ - ch = buffer[frag - 1]; /* last character in buffer */ - if (frag > 0) { /* if not an empty line */ - if (ch == '*') { - if (frag == 1 || ((strncmp(line,buffer,frag - 1)) == 0)) { + len = strlen(buffer); + if (len > 0) { /* if not an empty line */ + if (buffer[len-1] == '*') { + /* if last char is * and the rest of the chars match */ + if ((len == 1) || (strncmp(line,buffer,len - 1) == 0)) { result = TRUE; } - } else { /* last character = "*" test */ + } else { if (STREQ(line,buffer)) { result = TRUE; } - } /* last character = "*" test */ - } /* frag >= 0 */ - } /* end while */ + } + } + } /* end while loop over the file */ FREE(buffer); FREE(line); diff --git a/src/LYUtils.c b/src/LYUtils.c index cfb9028d..7a7ed0ce 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -5679,7 +5679,7 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char *, name, char *, mode) * This won't work properly if the user is root, since the chmod succeeds. */ } else if (*mode != 'a') { - int save = umask(HIDE_UMASK); + mode_t save = umask(HIDE_UMASK); if (chmod(name, HIDE_CHMOD) == 0 || errno == ENOENT) fp = fopen(name, mode); umask(save); @@ -5746,7 +5746,7 @@ PUBLIC FILE *LYAppendToTxtFile ARGS1(char *, name) */ PUBLIC void LYRelaxFilePermissions ARGS1(CONST char *, name) { - int mode; + mode_t mode; struct stat stat_buf; if (stat(name, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode) && @@ -5756,7 +5756,7 @@ PUBLIC void LYRelaxFilePermissions ARGS1(CONST char *, name) * temp file paranoid permissions (and the umask wasn't even * more restrictive when it was copied). - kw */ - int save = umask(HIDE_UMASK); + mode_t save = umask(HIDE_UMASK); mode = ((mode & 0700) | 0066) & ~save; umask(save); chmod(name, mode); diff --git a/src/chrtrans/makefile.in b/src/chrtrans/makefile.in index dbba4fd7..2e2f2681 100644 --- a/src/chrtrans/makefile.in +++ b/src/chrtrans/makefile.in @@ -22,19 +22,21 @@ LDFLAGS = @LDFLAGS@ INTLLIB = @INTLDIR_MAKE@@INTLLIBS@ WWWINC = WWW/Library/Implementation +INTLDIR_CPPFLAGS= @INTLDIR_CPPFLAGS@-I$(top_srcdir)/intl + SITE_DEFS = # FIXME: set in parent makefile CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ + CPP_OPTS = @DEFS@ @CPPFLAGS@ \ -I$(top_builddir) \ - -I$(top_srcdir)/intl \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/chrtrans \ -I$(top_srcdir)/$(WWWINC) \ -I$(top_srcdir)/ \ - $(SITE_DEFS) + $(INTLDIR_CPPFLAGS) $(SITE_DEFS) CC_OPTS = $(CPP_OPTS) $(CFLAGS) # diff --git a/src/makefile.in b/src/makefile.in index a46b42e3..ba451262 100644 --- a/src/makefile.in +++ b/src/makefile.in @@ -36,6 +36,7 @@ WWWINC = WWW/Library/Implementation WWWLIB = $(top_builddir)/WWW/Library/Implementation/libwww.a INTLLIB = @INTLDIR_MAKE@@INTLLIBS@ +INTLDIR_CPPFLAGS= @INTLDIR_CPPFLAGS@-I$(top_srcdir)/intl CPP_OPTS = $(DEFS) $(CPPFLAGS) \ -DLOCALEDIR=\"$(localedir)\" \ @@ -46,7 +47,7 @@ CPP_OPTS = $(DEFS) $(CPPFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -I$(top_srcdir)/$(WWWINC) \ - @INTLDIR_CPPFLAGS@ $(SITE_DEFS) + $(INTLDIR_CPPFLAGS) $(SITE_DEFS) CC_OPTS = $(CPP_OPTS) $(CFLAGS) LINT = @LINT@ @@ -169,7 +170,7 @@ $(TABLES): -cd chrtrans && $(MAKE) tables UCdomap.o: UCdomap.c chrtrans/UCkd.h chrtrans/makeuctb$x chrtrans/makeuctb.c \ - UCdomap.h $(CMN)UCMap.h $(TABLES) $(top_srcdir)/userdefs.h + UCdomap.h $(CMN)UCMap.h $(TABLES) $(top_srcdir)/userdefs.h UCAux.o : UCAux.c $(CMN)UCAux.h $(CMN)UCDefs.h LYCookie.o: $(top_srcdir)/userdefs.h |