Peter Breitenlohner
2007-Jan-10 09:23 UTC
[syslinux] tftp-hpa-0.46 -- a suggestion plus patch
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 ===================
Op 10-01-2007 om 10:23 schreef Peter Breitenlohner:> 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; > ========= end of patch ==================Patch looks good. Please confirm that the posting of the patch to the syslinux mailinglist should be read as "permission granted to include the modification in the main branch of tftp-hpa" Cheers Geert Stappers in another attempt to provoke feedback on patches to this mailinglist.
Peter Breitenlohner
2007-Jan-15 13:13 UTC
[syslinux] tftp-hpa-0.46 -- a suggestion plus patch
On Sat, 13 Jan 2007, Geert Stappers wrote:> Patch looks good. > > Please confirm that the posting of the patch to the syslinux mailinglist > should be read as "permission granted to include the modification > in the main branch of tftp-hpa"Yes, of course; I sent the patch exactly for the purpose to be included into tftp-hpa. Cheers Peter Breitenlohner
Op 15-01-2007 om 14:13 schreef Peter Breitenlohner:> On Sat, 13 Jan 2007, Geert Stappers wrote: > > > Patch looks good. > > > > Please confirm that the posting of the patch to the syslinux mailinglist > > should be read as "permission granted to include the modification > > in the main branch of tftp-hpa" > > Yes, of course; I sent the patch exactly for the purpose to be included into > tftp-hpa.<screenshot> stappers at bahrain:/usr/src/tftp-hpa-0.47 $ head CHANGES Changes in 0.47: Add -L option to the server to run standalone without detaching from the shell. Parallel make fix. Changes in 0.46: Minor portability improvements. stappers at bahrain:/usr/src/tftp-hpa-0.47 $ </screenshot>