From c4f21132e1c16f262bdbcf71c2a5493de0205b3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Mon, 29 Mar 2010 13:51:03 +0000 Subject: [PATCH] Accept spaces in the replacement label of the usertab file --- usertab.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usertab.c b/usertab.c index 51e1c4f..0adf064 100644 --- a/usertab.c +++ b/usertab.c @@ -58,8 +58,7 @@ static void init_file_usertab(const char *UserTabFile) FILE *fp_usr; long int nreg; char buf[MAXLEN]; - int z2; - int z1; + int z1, z2; if((fp_usr=fopen(UserTabFile,"r"))==NULL) { debuga(_("(usertab) Cannot open file %s - %s\n"),UserTabFile,strerror(errno)); @@ -92,13 +91,14 @@ static void init_file_usertab(const char *UserTabFile) } while(buf[z1] && (unsigned char)buf[z1]<=' ') z1++; userfile[z2++]='\n'; - while(buf[z1] && (unsigned char)buf[z1]>' ') { + while(buf[z1] && (unsigned char)buf[z1]>=' ') { if (z2+2>=nreg) { //need at least 2 additional bytes for "\t\0" debuga(_("The list of the users is too long in your %s file.\n"),UserTabFile); exit(EXIT_FAILURE); } userfile[z2++]=buf[z1++]; } + while(userfile[z2-1]==' ') z2--; userfile[z2++]='\t'; } userfile[z2]='\0'; -- 2.47.2