lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV Re: error recovery for form parsing


From: Roscinante
Subject: Re: LYNX-DEV Re: error recovery for form parsing
Date: Thu, 3 Apr 1997 16:40:54 -0500 (EST)


QUIT SENDING THIS SHIT TO MY EMAIL!!!!!!!!!!
/me kicks majordomo in the 'nads


On Thu, 3 Apr 1997, Laura Eaves wrote:

> Return-Path: address@hidden
> Received: from quartz.netop.sig.net (quartz.netop.sig.net [208.6.176.39]) by 
> fbn.ppp.cyberenet.net (8.8.5/8.6.9) with ESMTP id PAA20239 for 
> <address@hidden>; Thu, 3 Apr 1997 15:07:34 -0500
> Received: (from address@hidden) by quartz.netop.sig.net (8.8.5/8.7.3) id 
> MAA09774 for lynx-dev-031896; Thu, 3 Apr 1997 12:01:17 -0600 (CST)
> Date: Thu, 3 Apr 1997 13:02:13 -0500 (EST)
> From: Laura Eaves <address@hidden>
> Message-Id: <address@hidden>
> To: address@hidden
> Subject: LYNX-DEV Re: error recovery for form parsing
> Cc: address@hidden
> Sender: address@hidden
> Precedence: bulk
> Reply-To: address@hidden
> 
> I just noticed an oversight in the fix I just sent for the form
> parsing error recovery bug.
> Below is a diff containing the corrected fix...
> It handles the case where there is only one element on the stack.
> Sorry for the confusion.
> --le
> 
> *** old/SGML.c        Thu Apr  3 07:31:36 1997
> --- WWW/Library/Implementation/SGML.c Thu Apr  3 11:47:05 1997
> ***************
> *** 521,526 ****
> --- 521,527 ----
>                           old_tag->name);
>       return;
>       }
> + again:
>   #ifdef WIND_DOWN_STACK
>       while (context->element_stack) { /* Loop is error path only */
>   #else
> ***************
> *** 528,552 ****
>   #endif /* WIND_DOWN_STACK */
>       HTElement * N = context->element_stack;
>       HTTag * t = N->tag;
>       
>       if (old_tag != t) {             /* Mismatch: syntax error */
>           if (context->element_stack->next) { /* This is not the last level */
> !             if (TRACE) fprintf(stderr,
>               "SGML: Found </%s> when expecting </%s>. </%s> assumed.\n",
>                   old_tag->name, t->name, t->name);
>           } else {                    /* last level */
>               if (TRACE) fprintf(stderr,
>                   "SGML: Found </%s> when expecting </%s>. </%s> Ignored.\n",
>                   old_tag->name, t->name, old_tag->name);
>               return;                 /* Ignore */
>           }
> -         
>       }
>       
>       context->element_stack = N->next;               /* Remove from stack */
> !     FREE(N);
> !     (*context->actions->end_element)(context->target,
>                t - context->dtd->tags, (char **)&context->include);
>   #ifdef WIND_DOWN_STACK
>       if (old_tag == t)
>           return;  /* Correct sequence */
> --- 529,572 ----
>   #endif /* WIND_DOWN_STACK */
>       HTElement * N = context->element_stack;
>       HTTag * t = N->tag;
> +     int end_form_error = 0;
>       
>       if (old_tag != t) {             /* Mismatch: syntax error */
>           if (context->element_stack->next) { /* This is not the last level */
> !             if ( toupper(t->name[0]) == 'F'
> !             &&   toupper(t->name[1]) == 'O'
> !             &&   toupper(t->name[2]) == 'R'
> !             &&   toupper(t->name[3]) == 'M'
> !             &&   toupper(t->name[4]) == '\0' )
> !                 end_form_error = 1;
> !             if (TRACE) {
> !                 if ( end_form_error )
> !                     fprintf(stderr,
> !             "SGML: Found </%s> when expecting </%s>. </%s> hoisted.\n",
> !                 old_tag->name, t->name, t->name);
> !                 else
> !                     fprintf(stderr,
>               "SGML: Found </%s> when expecting </%s>. </%s> assumed.\n",
>                   old_tag->name, t->name, t->name);
> +             }
>           } else {                    /* last level */
>               if (TRACE) fprintf(stderr,
>                   "SGML: Found </%s> when expecting </%s>. </%s> Ignored.\n",
>                   old_tag->name, t->name, old_tag->name);
>               return;                 /* Ignore */
>           }
>       }
>       
>       context->element_stack = N->next;               /* Remove from stack */
> !     if ( !end_form_error ) {
> !         FREE(N);
> !         (*context->actions->end_element)(context->target,
>                t - context->dtd->tags, (char **)&context->include);
> +     } else {
> +         N->next = N->next->next;
> +         context->element_stack->next = N;
> +         goto again;
> +     }
>   #ifdef WIND_DOWN_STACK
>       if (old_tag == t)
>           return;  /* Correct sequence */
> ;
> ; To UNSUBSCRIBE:  Send a mail message to address@hidden
> ;                  with "unsubscribe lynx-dev" (without the
> ;                  quotation marks) on a line by itself.
> ;
> 

~~
All that is gold does not glitter..                          .
Not all those who wander are lost..J.R.R.Tolkien       .     /\     .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     ._____//  \\_____.
And the knowledge that they fear                    . \\    Rush    // .
is a weapon to be held against them.. N.P.          .   \\  2112  //   .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       .  //   /\   \\  .
Roscinante (address@hidden)              I[[[[[[[[]]]]]]]]I
http://fbn.ppp.cyberenet.net/

;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]