- printf("Which file do you wish to restore from? ");
- fgets(buf, sizeof(buf), stdin);
- if (feof(stdin))
- return;
- sp = strchr(buf, '\n');
- if (sp)
- *sp = '\0';
- rest_f(buf);
+ for (;;) {
+ printf("Which file do you wish to restore from? ");
+ fgets(buf, sizeof(buf), stdin);
+ if (feof(stdin))
+ return;
+ sp = strchr(buf, '\n');
+ if (sp)
+ *sp = '\0';
+ if (rest_f(buf) == 0)
+ break;
+ }