[syslinux] tftp-hpa-0.46 -- a suggestion plus patch
Peter Breitenlohner
peb at mppmu.mpg.de
Wed Jan 10 01:23:57 PST 2007
When the tftp (-hpa-0.46) client program is terminated by an EOF (i.e.
Ctrl-D) from the terminal, the program exits without writing a newline and
consequently the next shell-promt appears on the same line as the
tftp-prompt.
The patch below tries to fix this misbehaviour.
regards
Peter Breitenlohner <peb at mppmu.mpg.de>
======== begin of patch ==================
diff -ur tftp-hpa-0.46.orig/tftp/main.c tftp-hpa-0.46/tftp/main.c
--- tftp-hpa-0.46.orig/tftp/main.c 2007-01-09 01:54:30.000000000 +0100
+++ tftp-hpa-0.46/tftp/main.c 2007-01-09 19:48:49.000000000 +0100
@@ -352,8 +352,10 @@
len = strlen(partial);
eline = readline(mprompt);
- if (!eline)
+ if (!eline) {
+ printf("\n");
exit(0); /* EOF */
+ }
elen = strlen(eline);
@@ -375,8 +377,10 @@
strcpy(line, partial);
fputs(mprompt, stdout);
if ( fgets(line+len, LBUFLEN-len, stdin) == 0 )
- if ( feof(stdin) )
+ if ( feof(stdin) ) {
+ printf("\n");
exit(0); /* EOF */
+ }
#endif
}
@@ -770,12 +774,15 @@
line = NULL;
}
line = readline(prompt);
- if ( !line )
+ if ( !line ) {
+ printf("\n");
exit(0); /* EOF */
+ }
#else
fputs(prompt, stdout);
if (fgets(line, LBUFLEN, stdin) == 0) {
if (feof(stdin)) {
+ printf("\n");
exit(0);
} else {
continue;
========= and of patch ===================
More information about the Syslinux
mailing list