Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209308
b: refs/heads/master
c: 4418a2b
h: refs/heads/master
v: v3
  • Loading branch information
Jean Sacren authored and Michal Marek committed Aug 12, 2010
1 parent 1896409 commit b07ea26
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf5e327a300a9ac959a89440e7c67dc89f3bd804
refs/heads/master: 4418a2b904805814bbd14b555d6add6a175f49f3
15 changes: 13 additions & 2 deletions trunk/scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
check_stdin();
case oldaskconfig:
fflush(stdout);
fgets(line, 128, stdin);
xfgets(line, 128, stdin);
return 1;
default:
break;
Expand Down Expand Up @@ -306,7 +306,7 @@ static int conf_choice(struct menu *menu)
check_stdin();
case oldaskconfig:
fflush(stdout);
fgets(line, 128, stdin);
xfgets(line, 128, stdin);
strip(line);
if (line[0] == '?') {
print_help(menu);
Expand Down Expand Up @@ -644,3 +644,14 @@ int main(int ac, char **av)
}
return 0;
}
/*
* Helper function to facilitate fgets() by Jean Sacren.
*/
void xfgets(str, size, in)
char *str;
int size;
FILE *in;
{
if (fgets(str, size, in) == NULL)
fprintf(stderr, "\nError in reading or end of file.\n");
}
3 changes: 3 additions & 0 deletions trunk/scripts/kconfig/lkc.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ void zconf_nextfile(const char *name);
int zconf_lineno(void);
char *zconf_curname(void);

/* conf.c */
void xfgets(char *str, int size, FILE *in);

/* confdata.c */
const char *conf_get_configname(void);
const char *conf_get_autoconfig_name(void);
Expand Down

0 comments on commit b07ea26

Please sign in to comment.