- if (prompt)
- {
- fputs(prompt, termout);
- fflush(termout);
- }
-
- if (fgets(destination, maxlen + 1, termin) == NULL)
- destination[0] = '\0';
-
- length = strlen(destination);
- if (length > 0 && destination[length - 1] != '\n')
- {
- /* eat rest of the line */
- char buf[128];
- int buflen;
-
- do
- {
- if (fgets(buf, sizeof(buf), termin) == NULL)
- break;
- buflen = strlen(buf);
- } while (buflen > 0 && buf[buflen - 1] != '\n');
- }
-
- if (length > 0 && destination[length - 1] == '\n')
- /* remove trailing newline */
- destination[length - 1] = '\0';
+ if (prompt)
+ {
+ fputs(prompt, termout);
+ fflush(termout);
+ }
+
+ if (fgets(destination, maxlen + 1, termin) == NULL)
+ destination[0] = '\0';
+
+ length = strlen(destination);
+ if (length > 0 && destination[length - 1] != '\n')
+ {
+ /* eat rest of the line */
+ char buf[128];
+ int buflen;
+
+ do
+ {
+ if (fgets(buf, sizeof(buf), termin) == NULL)
+ break;
+ buflen = strlen(buf);
+ }
+ while (buflen > 0 && buf[buflen - 1] != '\n');
+ }
+
+ if (length > 0 && destination[length - 1] == '\n')
+ /* remove trailing newline */
+ destination[length - 1] = '\0';