[Mplayer-cvslog] CVS: main cfgparser.c,1.21,1.22

Szabolcs Berecz szabii at users.sourceforge.net
Mon Jun 11 01:40:22 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv8365

Modified Files:
	cfgparser.c 
Log Message:
bugfix

Index: cfgparser.c
===================================================================
RCS file: /cvsroot/mplayer/main/cfgparser.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** cfgparser.c	2001/06/10 23:06:44	1.21
--- cfgparser.c	2001/06/10 23:40:20	1.22
***************
*** 242,245 ****
--- 242,246 ----
  	int param_pos;	/* param pos */
  	int ret = 1;
+ 	int errors = 0;
  
  #ifdef DEBUG
***************
*** 277,280 ****
--- 278,287 ----
  
  	while (fgets(line, MAX_LINE_LEN, fp)) {
+ nextline:
+ 		if (errors >= 16) {
+ 			printf("too many errors\n");
+ 			goto out;
+ 		}
+ 
  		line_num++;
  		line_pos = 0;
***************
*** 297,302 ****
  				PRINT_LINENUM;
  				printf("too long option\n");
  				ret = -1;
! 				continue;
  			}
  		}
--- 304,310 ----
  				PRINT_LINENUM;
  				printf("too long option\n");
+ 				errors++;
  				ret = -1;
! 				goto nextline;
  			}
  		}
***************
*** 305,308 ****
--- 313,317 ----
  			printf("parse error\n");
  			ret = -1;
+ 			errors++;
  			continue;
  		}
***************
*** 322,325 ****
--- 331,335 ----
  			printf("option without parameter\n");
  			ret = -1;
+ 			errors++;
  			continue;
  		}
***************
*** 339,343 ****
  					printf("too long parameter\n");
  					ret = -1;
! 					continue;
  				}
  			}
--- 349,354 ----
  					printf("too long parameter\n");
  					ret = -1;
! 					errors++;
! 					goto nextline;
  				}
  			}
***************
*** 351,355 ****
  					printf("too long parameter\n");
  					ret = -1;
! 					continue;
  				}
  			}
--- 362,367 ----
  					printf("too long parameter\n");
  					ret = -1;
! 					errors++;
! 					goto nextline;
  				}
  			}
***************
*** 362,365 ****
--- 374,378 ----
  			printf("option without parameter\n");
  			ret = -1;
+ 			errors++;
  			continue;
  		}
***************
*** 389,392 ****
--- 402,406 ----
  			printf("%s\n", opt);
  			ret = -1;
+ 			errors++;
  			continue;
  			/* break */


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list