cvs commit: apache-1.3/src/modules/standard mod_imap.c

1998-10-23 Thread rse
rse 98/10/23 01:32:30

  Modified:src  CHANGES
   src/modules/standard mod_imap.c
  Log:
  Fix multiple whitespace handling in imagemaps for mod_imap which was
  broken since Apache 1.3.1 where we took out compressing of multiple
  spaces in ap_cfg_getline().
  
  Submitted by: Ivan Richwalski [EMAIL PROTECTED]
  Reviewed by: Ralf S. Engelschall
  PR: 3249
  
  Revision  ChangesPath
  1.1120+5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1119
  retrieving revision 1.1120
  diff -u -r1.1119 -r1.1120
  --- CHANGES   1998/10/23 08:14:58 1.1119
  +++ CHANGES   1998/10/23 08:32:25 1.1120
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.4
   
  +  *) Fix multiple whitespace handling in imagemaps for mod_imap which was
  + broken since Apache 1.3.1 where we took out compressing of multiple
  + spaces in ap_cfg_getline().
  + [Ivan Richwalski [EMAIL PROTECTED]] PR#3249
  +
 *) Fix Berkeley-DB/2.x support in mod_auth_db: The data structures were not
initialized correctly and the db_open() call used an invalid mode
parameter. [Ron Klatchko [EMAIL PROTECTED]] PR#3171
  
  
  
  1.49  +9 -6  apache-1.3/src/modules/standard/mod_imap.c
  
  Index: mod_imap.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_imap.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- mod_imap.c1998/08/06 17:30:58 1.48
  +++ mod_imap.c1998/10/23 08:32:29 1.49
  @@ -679,11 +679,10 @@
  if we aren't printing a menu */
   
/* find the first two space delimited fields, recall that
  -  * cfg_getline has removed leading/trailing whitespace and
  -  * compressed the other whitespace down to one space a piece
  +  * ap_cfg_getline has removed leading/trailing whitespace.
 *
 * note that we're tokenizing as we go... if we were to use the
  -  * getword() class of functions we would end up allocating extra
  +  * ap_getword() class of functions we would end up allocating extra
 * memory for every line of the map file
 */
   string_pos = input;
  @@ -692,7 +691,7 @@
}
   
directive = string_pos;
  - while (*string_pos  *string_pos != ' ') { /* past directive */
  + while (*string_pos  !ap_isspace(*string_pos)) {   /* past 
directive */
++string_pos;
}
if (!*string_pos) { /* need at least two fields */
  @@ -703,11 +702,15 @@
if (!*string_pos) { /* need at least two fields */
goto need_2_fields;
}
  + while(*string_pos  ap_isspace(*string_pos)) { /* past whitespace */
  + ++string_pos;
  + }
  +
value = string_pos;
  - while (*string_pos  *string_pos != ' ') { /* past value */
  + while (*string_pos  !ap_isspace(*string_pos)) {   /* past value */
++string_pos;
}
  - if (*string_pos == ' ') {
  + if (ap_isspace(*string_pos)) {
*string_pos++ = '\0';
}
else {
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_imap.c

1998-03-01 Thread dgaudet
dgaudet 98/02/28 16:31:51

  Modified:src  CHANGES
   src/modules/standard mod_imap.c
  Log:
  fix border processing for polys
  
  PR:   1771
  Submitted by: Konstantin Morshnev [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.675 +4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.674
  retrieving revision 1.675
  diff -u -r1.674 -r1.675
  --- CHANGES   1998/03/01 00:19:33 1.674
  +++ CHANGES   1998/03/01 00:31:47 1.675
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3b6
   
  +  *) The poly directive in image maps did not include the borders of the
  + polygon, whereas the rect directive does.  Fix this inconsistency.
  + [Konstantin Morshnev [EMAIL PROTECTED]] PR#1771
  +
 *) Make \\ behave as expected.  [EMAIL PROTECTED]
   
 *) Add `Rule HIDE' to Configuration to hide the Apache symbol
  
  
  
  1.42  +23 -74apache-1.3/src/modules/standard/mod_imap.c
  
  Index: mod_imap.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_imap.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- mod_imap.c1998/02/01 22:05:40 1.41
  +++ mod_imap.c1998/03/01 00:31:50 1.42
  @@ -196,86 +196,35 @@
   return (radius2 = radius1);
   }
   
  +#define fmin(a,b) (((a)(b))?(b):(a))
  +#define fmax(a,b) (((a)(b))?(a):(b))
  +
   static int pointinpoly(const double point[2], double pgon[MAXVERTS][2])
   {
  -int i, numverts, inside_flag, xflag0;
  -int crossings;
  -double *p;
  -const double *stop;
  -double tx, ty, y;
  -
  -for (i = 0; pgon[i][X] != -1  i  MAXVERTS; i++);
  -
  -numverts = i;
  -crossings = 0;
  -
  -tx = point[X];
  -ty = point[Y];
  -y = pgon[numverts - 1][Y];
  +int i, numverts, crossings = 0;
  +double x = point[X], y = point[Y];
   
  -p = (double *) pgon + 1;
  -if ((y = ty) != (*p = ty)) {
  -
  - xflag0 = (pgon[numverts - 1][X] = tx);
  -if (xflag0 == (*(double *) pgon = tx)) {
  -if (xflag0) {
  -crossings++;
  - }
  -}
  -else {
  -crossings += (pgon[numverts - 1][X] - (y - ty) *
  -  (*(double *) pgon - pgon[numverts - 1][X]) /
  -  (*p - y)) = tx;
  -}
  +for (numverts = 0; pgon[numverts][X] != -1  numverts  MAXVERTS;
  + numverts++) {
  + /* just counting the vertexes */
   }
   
  -stop = pgon[numverts];
  -
  -for (y = *p, p += 2; p  stop; y = *p, p += 2) {
  -
  -if (y = ty) {
  -
  -while ((p  stop)  (*p = ty)) {
  -p += 2;
  - }
  -
  -if (p = stop) {
  -break;
  -}
  - if ((xflag0 = (*(p - 3) = tx)) == (*(p - 1) = tx)) {
  -
  -if (xflag0) {
  -crossings++;
  - }
  -}
  -else {
  -crossings += (*(p - 3) - (*(p - 2) - ty) *
  -  (*(p - 1) - *(p - 3)) / (*p - *(p - 2))) = tx;
  -}
  -}
  -else {
  -while ((p  stop)  (*p  ty)) {
  -p += 2;
  - }
  -
  -if (p = stop) {
  -break;
  - }
  -
  -if ((xflag0 = (*(p - 3) = tx)) == (*(p - 1) = tx)) {
  -if (xflag0) {
  -crossings++;
  - }
  -}
  -else {
  -crossings += (*(p - 3) - (*(p - 2) - ty) *
  -  (*(p - 1) - *(p - 3)) / (*p - *(p - 2))) = tx;
  -}
  -}
  +for (i = 0; i  numverts; i++) {
  +double x1=pgon[i][X];
  +double y1=pgon[i][Y];
  +double x2=pgon[(i + 1) % numverts][X];
  +double y2=pgon[(i + 1) % numverts][Y];
  +double d=(y - y1) * (x2 - x1) - (x - x1) * (y2 - y1);
  +
  +if ((y1 = y) != (y2 = y)) {
  + crossings +=y2 - y1 = 0 ? d = 0 : d = 0;
  + }
  +if (!d  fmin(x1,x2) = x  x = fmax(x1,x2)
  +  fmin(y1,y2) = y  y = fmax(y1,y2)) {
  + return 1;
  + }
   }
  -
  -inside_flag = crossings  0x01;
  -return (inside_flag);
  +return crossings  0x01;
   }