diff options
-rw-r--r-- | CHANGES | 7 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFWriter.c | 359 | ||||
-rw-r--r-- | lynx.rsp | 86 | ||||
-rw-r--r-- | src/GridText.c | 4 |
4 files changed, 7 insertions, 449 deletions
diff --git a/CHANGES b/CHANGES index d5f1aea0..6f28e514 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,12 @@ --- $LynxId: CHANGES,v 1.514 2010/11/08 10:12:13 tom Exp $ +-- $LynxId: CHANGES,v 1.515 2010/11/22 13:02:10 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2010-11-08 (2.8.8dev.7) +2010-11-21 (2.8.8dev.7) +* correct one of the places where link-number is formatted, for form input + anchors. This was broken in dev.6 by the -unique_urls changes (report by + DK) -TD * undo a cleanup change to link-types from dev.6 which broke some uses of input-anchors (report by FLWM) -TD * minor formatting improvements to sources using cindent 2.0-20101107 -TD diff --git a/WWW/Library/Implementation/HTFWriter.c b/WWW/Library/Implementation/HTFWriter.c deleted file mode 100644 index 1680b238..00000000 --- a/WWW/Library/Implementation/HTFWriter.c +++ /dev/null @@ -1,359 +0,0 @@ -/* FILE WRITER HTFWrite.h - * =========== - * - * This version of the stream object just writes to a C file. - * The file is assumed open and left open. - * - * Bugs: - * strings written must be less than buffer size. - */ - -#include <HTUtils.h> - -#include <HTFWriter.h> - -#include <HTFormat.h> -#include <HTAlert.h> -#include <HTFile.h> - -#include <LYUtils.h> -#include <LYLeaks.h> - -/* Stream Object - * ------------ - */ - -struct _HTStream { - const HTStreamClass *isa; - - FILE *fp; - char *end_command; - char *remove_command; - BOOL announce; -}; - -/*_________________________________________________________________________ - * - * B L A C K H O L E C L A S S - * - * There is only one black hole instance shared by anyone - * who wanst a black hole. These black holes don't radiate, - * they just absorb data. - */ -static void HTBlackHole_put_character(HTStream *me, char c) -{ -} -static void HTBlackHole_put_string(HTStream *me, const char *s) -{ -} -static void HTBlackHole_write(HTStream *me, const char *s, int l) -{ -} -static void HTBlackHole_free(HTStream *me) -{ -} -static void HTBlackHole_abort(HTStream *me, HTError e) -{ -} - -/* Black Hole stream - * ----------------- - */ -static const HTStreamClass HTBlackHoleClass = -{ - "BlackHole", - HTBlackHole_free, - HTBlackHole_abort, - HTBlackHole_put_character, HTBlackHole_put_string, - HTBlackHole_write -}; - -static HTStream HTBlackHoleInstance = -{ - &HTBlackHoleClass, - NULL, - NULL, - NULL, - NO -}; - -/* Black hole craetion -*/ -HTStream *HTBlackHole(void) -{ - return &HTBlackHoleInstance; -} - -/*_________________________________________________________________________ - * - * F I L E A C T I O N R O U T I N E S - * Bug: - * All errors are ignored. - */ - -/* Character handling - * ------------------ - */ - -static void HTFWriter_put_character(HTStream *me, char c) -{ - putc(c, me->fp); -} - -/* String handling - * --------------- - * - * Strings must be smaller than this buffer size. - */ -static void HTFWriter_put_string(HTStream *me, const char *s) -{ - fputs(s, me->fp); -} - -/* Buffer write. Buffers can (and should!) be big. - * ------------ - */ -static void HTFWriter_write(HTStream *me, const char *s, int l) -{ - fwrite(s, 1, l, me->fp); -} - -/* Free an HTML object - * ------------------- - * - * Note that the SGML parsing context is freed, but the created - * object is not, - * as it takes on an existence of its own unless explicitly freed. - */ -static void HTFWriter_free(HTStream *me) -{ - fclose(me->fp); - if (me->end_command) { /* Temp file */ - _HTProgress(me->end_command); /* Tell user what's happening */ - system(me->end_command); - FREE(me->end_command); - if (me->remove_command) { - system(me->remove_command); - FREE(me->remove_command); - } - } - - FREE(me); -} - -/* End writing -*/ - -static void HTFWriter_abort(HTStream *me, HTError e) -{ - fclose(me->fp); - if (me->end_command) { /* Temp file */ - CTRACE((tfp, "HTFWriter: Aborting: file not executed.\n")); - FREE(me->end_command); - if (me->remove_command) { - system(me->remove_command); - FREE(me->remove_command); - } - } - - FREE(me); -} - -/* Structured Object Class - * ----------------------- - */ -static const HTStreamClass HTFWriter = /* As opposed to print etc */ -{ - "FileWriter", - HTFWriter_free, - HTFWriter_abort, - HTFWriter_put_character, HTFWriter_put_string, - HTFWriter_write -}; - -/* Subclass-specific Methods - * ------------------------- - */ - -HTStream *HTFWriter_new(FILE *fp) -{ - HTStream *me; - - if (!fp) - return NULL; - - me = (HTStream *) malloc(sizeof(*me)); - if (me == NULL) - outofmem(__FILE__, "HTML_new"); - - assert(me != NULL); - - me->isa = &HTFWriter; - - me->fp = fp; - me->end_command = NULL; - me->remove_command = NULL; - me->announce = NO; - - return me; -} - -/* Make system command from template - * --------------------------------- - * - * See mailcap spec for description of template. - */ -/* @@ to be written. sprintfs will do for now. */ - -/* Take action using a system command - * ---------------------------------- - * - * originally from Ghostview handling by Marc Andreseen. - * Creates temporary file, writes to it, executes system command - * on end-document. The suffix of the temp file can be given - * in case the application is fussy, or so that a generic opener can - * be used. - */ -HTStream *HTSaveAndExecute(HTPresentation *pres, - HTParentAnchor *anchor, /* Not used */ - HTStream *sink) /* Not used */ - -#ifdef UNIX -#define REMOVE_COMMAND "/bin/rm -f %s\n" -#endif -#ifdef VMS -#define REMOVE_COMMAND "delete/noconfirm/nolog %s.." -#endif - -#ifdef REMOVE_COMMAND -{ - char *fnam; - const char *suffix; - - HTStream *me; - - if (HTClientHost) { - HTAlert(CANNOT_SAVE_REMOTE); - return HTBlackHole(); - } - - me = (HTStream *) malloc(sizeof(*me)); - if (me == NULL) - outofmem(__FILE__, "Save and execute"); - - assert(me != NULL); - - me->isa = &HTFWriter; - - /* Save the file under a suitably suffixed name */ - - suffix = HTFileSuffix(pres->rep, anchor->content_encoding); - - fnam = (char *) malloc(L_tmpnam + 16 + strlen(suffix)); - if (fnam == NULL) - outofmem(__FILE__, "HTSaveAndExecute"); - - assert(fnam != NULL); - - tmpnam(fnam); - strcat(fnam, suffix); - - me->fp = fopen(fnam, BIN_W); - if (!me->fp) { - HTAlert(CANNOT_OPEN_TEMP); - FREE(fnam); - FREE(me); - return NULL; - } - -/* Make command to process file -*/ - me->end_command = 0; - HTSprintf0(&(me->end_command), pres->command, fnam, fnam, fnam); - - me->remove_command = NULL; /* If needed, put into end_command */ -#ifdef NOPE -/* Make command to delete file -*/ - me->remove_command = 0; - HTSprintf0(&(me->remove_command), REMOVE_COMMAND, fnam); -#endif - - me->announce = NO; - FREE(fnam); - return me; -} - -#else /* can do remove */ -{ - return NULL; -} -#endif - -/* Save Locally - * ------------ - * - * Bugs: - * GUI Apps should open local Save panel here really. - * - */ -HTStream *HTSaveLocally(HTPresentation *pres, - HTParentAnchor *anchor, /* Not used */ - HTStream *sink) /* Not used */ - -{ - char *fnam; - char *answer; - const char *suffix; - - HTStream *me; - - if (HTClientHost) { - HTAlert(CANNOT_SAVE_REMOTE); - return HTBlackHole(); - } - - me = (HTStream *) malloc(sizeof(*me)); - if (me == NULL) - outofmem(__FILE__, "SaveLocally"); - - assert(me != NULL); - - me->isa = &HTFWriter; - me->end_command = NULL; - me->remove_command = NULL; /* If needed, put into end_command */ - me->announce = YES; - - /* Save the file under a suitably suffixed name */ - - suffix = HTFileSuffix(pres->rep, anchor->content_encoding); - - fnam = (char *) malloc(L_tmpnam + 16 + strlen(suffix)); - if (fnam == NULL) - outofmem(__FILE__, "HTSaveLocally"); - - assert(fnam != NULL); - - tmpnam(fnam); - strcat(fnam, suffix); - - /* Save Panel */ - answer = HTPrompt(GIVE_FILENAME, fnam); - - FREE(fnam); - - me->fp = fopen(answer, BIN_W); - if (!me->fp) { - HTAlert(CANNOT_OPEN_OUTPUT); - FREE(answer); - FREE(me); - return NULL; - } - - FREE(answer); - return me; -} - -/* Format Converter using system command - * ------------------------------------- - */ diff --git a/lynx.rsp b/lynx.rsp deleted file mode 100644 index dacdf393..00000000 --- a/lynx.rsp +++ /dev/null @@ -1,86 +0,0 @@ -../obj/DefaultStyle.obj -../obj/GridText.obj -../obj/HTAabrow.obj -../obj/HTAaprot.obj -../obj/HTAautil.obj -../obj/HTAccess.obj -../obj/HTAlert.obj -../obj/HTAnchor.obj -../obj/HTAssoc.obj -../obj/HTAtom.obj -../obj/HTBtree.obj -../obj/HTChunk.obj -../obj/HTDOS.obj -../obj/HTFile.obj -../obj/HTFinger.obj -../obj/HTFormat.obj -../obj/HTFtp.obj -../obj/HTFwriter.obj -../obj/HTGopher.obj -../obj/HTGroup.obj -../obj/HTInit.obj -../obj/HTLex.obj -../obj/HTList.obj -../obj/HTMIME.obj -../obj/HTML.obj -../obj/HTMLDTD.obj -../obj/HTMLGen.obj -../obj/HTNews.obj -../obj/HTParse.obj -../obj/HTPlain.obj -../obj/HTRules.obj -../obj/HTString.obj -../obj/HTStyle.obj -../obj/HTTP.obj -../obj/HTTcp.obj -../obj/HTTelnet.obj -../obj/HTUU.obj -../obj/HTWSRC.obj -../obj/LYBookmark.obj -../obj/LYCgi.obj -../obj/LYCharSets.obj -../obj/LYCharUtils.obj -../obj/LYClean.obj -../obj/LYCookie.obj -../obj/LYCurses.obj -../obj/LYDownload.obj -../obj/LYEdit.obj -../obj/LYEditmap.obj -../obj/LYExit.obj -../obj/LYExtern.obj -../obj/LYForms.obj -../obj/LYGetFile.obj -../obj/LYHistory.obj -../obj/LYJump.obj -../obj/LYKeymap.obj -../obj/LYLeaks.obj -../obj/LYList.obj -../obj/LYLocal.obj -../obj/LYMail.obj -../obj/LYMain.obj -../obj/LYMainLoop.obj -../obj/LYMap.obj -../obj/LYNews.obj -../obj/LYOptions.obj -../obj/LYPrint.obj -../obj/LYPrettySrc.obj -../obj/LYReadCFG.obj -../obj/LYSearch.obj -../obj/LYSession.obj -../obj/LYShowInfo.obj -../obj/LYStrings.obj -../obj/LYTraversal.obj -../obj/LYUpload.obj -../obj/LYmktime.obj -../obj/LYrcFile.obj -../obj/parsdate.obj -../obj/SGML.obj -../obj/TRSTable.obj -../obj/UCAuto.obj -../obj/UCAux.obj -../obj/UCdomap.obj -../obj/lyutils.obj -../obj/xsystem.obj -../curses/PDCURSES.LIB -../curses/ZLIB.LIB -../curses/iconv.lib diff --git a/src/GridText.c b/src/GridText.c index 22713ef9..6d382d59 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -1,5 +1,5 @@ /* - * $LynxId: GridText.c,v 1.206 2010/11/08 09:57:30 tom Exp $ + * $LynxId: GridText.c,v 1.207 2010/11/22 12:55:04 tom Exp $ * * Character grid hypertext object * =============================== @@ -10379,7 +10379,7 @@ int HText_beginInput(HText *text, } if (fields_are_numbered() && (a->number > 0)) { if (HTMainText != 0) { - a->show_number = HTMainText->next_number++; + HText_findAnchorNumber(a); } else { a->show_number = a->number; } |