do not print extra lines in fcdcmd

This commit is contained in:
hsn 2005-07-26 22:15:16 +00:00
parent c0b9c1c999
commit f1ad9fc8b8
3 changed files with 19 additions and 7 deletions

View File

@ -16,7 +16,8 @@ Version NEXT
updated year in copyright (todo!!) updated year in copyright (todo!!)
fsetup command added to setup.sh fsetup command added to setup.sh
fsetup command added to setup.csh 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 Version 2.8.1b24 - 19 Feb 2005
use getopt from stdio.h instead of getopt.h in fspscan.c use getopt from stdio.h instead of getopt.h in fspscan.c

View File

@ -1,5 +1,6 @@
/*********************************************************************\ /*********************************************************************\
* Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu) * * 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 * * 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 * * that this notice is always included, and that you hold the author *

View File

@ -1,5 +1,6 @@
/*********************************************************************\ /*********************************************************************\
* Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu) * * 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 * * 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 * * that this notice is always included, and that you hold the author *
@ -24,24 +25,33 @@
int print_pro (UBUF * ub, FILE * where) int print_pro (UBUF * ub, FILE * where)
{ {
char flags; char flags;
unsigned len, len1; unsigned len, len2;
char *pro1, *pro2; char *pro1, *pro2;
char *c;
/* length of readme */ /* length of readme */
len = BB_READ2(ub->bb_len); len = BB_READ2(ub->bb_len);
/* len1= size of extended protection data */ /* len2= size of extended protection data */
len1 = BB_READ4(ub->bb_pos); len2 = BB_READ4(ub->bb_pos);
pro1 = ub->buf; pro1 = ub->buf;
pro2 = ub->buf+len; pro2 = ub->buf+len;
if(len1) { if(len2) {
flags = *pro2; flags = *pro2;
fprintf(where,"owner: %s, del: %s, create: %s, mkdir: %s, get: %s, list: %s, rename: %s.\n", 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), 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_MKDIR), N_or_Y(DIR_GET), Y_or_N(DIR_LIST),
Y_or_N(DIR_RENAME)); Y_or_N(DIR_RENAME));
} }
if(len) fprintf(where,"%s", pro1); if(len>1)
fprintf(where,"\n"); {
/* 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); return(0);
} }