could someone please explain to me why this function is stopping before the fgets inside the else block. After it prints the first message after the else it jumps to the system() call after the else block.

Code:
void config(const char options[])
{
	char default_config[] = " --prefix=/usr --disable-nls";
	char custom_config[BUFSIZ];
	char whole_config_line[BUFSIZ];
	char *p;

	strcpy(whole_config_line, "./configure ");

	if( ( strcmp(options, "default") == 0)){
		strcat(whole_config_line, default_config);
	} else {

		printf("please give configure options: \n");
	/* stopping here. why? */
		fflush(stdout);
		fgets(custom_config, sizeof(custom_config), stdin);
		p = strchr(custom_config, '\n');
		*p = '\0';
		strcat(whole_config_line, custom_config);
	}

	system(whole_config_line);
}