From f1ad9fc8b8a93b1c2262431eb03f23fd2825a5c8 Mon Sep 17 00:00:00 2001 From: hsn <> Date: Tue, 26 Jul 2005 22:15:16 +0000 Subject: [PATCH] do not print extra lines in fcdcmd --- ChangeLog | 3 ++- clients/fcdcmd.c | 1 + clients/printpro.c | 22 ++++++++++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 653ac7c..5301181 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,7 +16,8 @@ Version NEXT updated year in copyright (todo!!) fsetup command added to setup.sh fsetup command added to setup.csh - + fcd: remove trailing \r\n from readme file + fcd: do not print empty line after directory protection Version 2.8.1b24 - 19 Feb 2005 use getopt from stdio.h instead of getopt.h in fspscan.c diff --git a/clients/fcdcmd.c b/clients/fcdcmd.c index 04fb4ca..ebe85ae 100644 --- a/clients/fcdcmd.c +++ b/clients/fcdcmd.c @@ -1,5 +1,6 @@ /*********************************************************************\ * Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu) * + * Copyright (c) 2005 by Radim Kolar (hsn@cybermail.net) * * * * You may copy or modify this file in any manner you wish, provided * * that this notice is always included, and that you hold the author * diff --git a/clients/printpro.c b/clients/printpro.c index 9719e79..67beb68 100644 --- a/clients/printpro.c +++ b/clients/printpro.c @@ -1,5 +1,6 @@ /*********************************************************************\ * Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu) * + * Copyright (c) 2005 by Radim Kolar (hsn@cybermail.net) * * * * You may copy or modify this file in any manner you wish, provided * * that this notice is always included, and that you hold the author * @@ -24,24 +25,33 @@ int print_pro (UBUF * ub, FILE * where) { char flags; - unsigned len, len1; + unsigned len, len2; char *pro1, *pro2; + char *c; /* length of readme */ len = BB_READ2(ub->bb_len); - /* len1= size of extended protection data */ - len1 = BB_READ4(ub->bb_pos); + /* len2= size of extended protection data */ + len2 = BB_READ4(ub->bb_pos); pro1 = ub->buf; pro2 = ub->buf+len; - if(len1) { + if(len2) { flags = *pro2; fprintf(where,"owner: %s, del: %s, create: %s, mkdir: %s, get: %s, list: %s, rename: %s.\n", Machine(DIR_OWNER), Y_or_N(DIR_DEL), Y_or_N(DIR_ADD), Y_or_N(DIR_MKDIR), N_or_Y(DIR_GET), Y_or_N(DIR_LIST), Y_or_N(DIR_RENAME)); } - if(len) fprintf(where,"%s", pro1); - fprintf(where,"\n"); + if(len>1) + { + /* remove trailing \n\r from README */ + c=pro1+strlen(pro1)-1; + while(*c=='\n' || *c=='\r') + c--; + *c='\0'; + + fprintf(where,"%s\n", pro1); + } return(0); }