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

Szabolcs Berecz szabii at users.sourceforge.net
Mon Jun 11 01:06:46 CEST 2001


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

Modified Files:
	cfgparser.c 
Log Message:
some fix

Index: cfgparser.c
===================================================================
RCS file: /cvsroot/mplayer/main/cfgparser.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** cfgparser.c	2001/06/09 17:41:31	1.20
--- cfgparser.c	2001/06/10 23:06:44	1.21
***************
*** 246,254 ****
  	assert(conffile != NULL);
  #endif
! 	if (++recursion_depth > MAX_RECURSION_DEPTH) {
! 		printf("too deep 'include'. check your configfiles\n");
! 		--recursion_depth;
! 		return -1;
! 	}		
  
  	if (init_conf(conf, CONFIG_FILE) == -1) {
--- 246,257 ----
  	assert(conffile != NULL);
  #endif
! 	if (++recursion_depth > 1)
! 		printf("Reading config file: %s", conffile);
! 
! 	if (recursion_depth > MAX_RECURSION_DEPTH) {
! 		printf(": too deep 'include'. check your configfiles\n");
! 		ret = -1;
! 		goto out;
! 	}
  
  	if (init_conf(conf, CONFIG_FILE) == -1) {
***************
*** 264,271 ****
--- 267,278 ----
  
  	if ((fp = fopen(conffile, "r")) == NULL) {
+ 		if (recursion_depth > 1)
+ 			printf(": %s\n", strerror(errno));
  		free(line);
  		ret = 0;
  		goto out;
  	}
+ 	if (recursion_depth > 1)
+ 		printf("\n");
  
  	while (fgets(line, MAX_LINE_LEN, fp)) {
***************
*** 410,413 ****
--- 417,423 ----
  		return -1;
  
+ 	/* in order to work recursion detection properly in parse_config_file */
+ 	++recursion_depth;
+ 
  	for (i = 1; i < argc; i++) {
  		opt = argv[i];
***************
*** 444,450 ****
  			i += tmp;
  		}
! 	}	
  	return found_filename;
  err_out:
  	printf("command line: %s\n", argv[i]);
  	return -1;
--- 454,462 ----
  			i += tmp;
  		}
! 	}
! 	--recursion_depth;
  	return found_filename;
  err_out:
+ 	--recursion_depth;
  	printf("command line: %s\n", argv[i]);
  	return -1;


_______________________________________________
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