Date: Wed, 6 Jan 1999 02:30:02 -0800 (PST) From: Slaven Rezic <eserte@cs.tu-berlin.de> To: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/3246: mtree -c should escape whitespace and special characters Message-ID: <199901061030.CAA08078@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/3246; it has been noted by GNATS. From: Slaven Rezic <eserte@cs.tu-berlin.de> To: Joseph Koshy <jkoshy@FreeBSD.ORG> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/3246: mtree -c should escape whitespace and special characters Date: 06 Jan 1999 11:09:54 +0100 Joseph Koshy <jkoshy@FreeBSD.ORG> writes: > > > > I was looking at your PR with the intent of committing the patches. > I have a few points: > > 1. new file `escape.c' > > - needs a copyright (you could copy the copyright from the other > files). Alternatively you could fold the code into an > existing file like `misc.c'. > > - needs to follow the same source style as the rest of mtree > (see style(9) for hints) > > The same comments apply to "escape.h" too. > > 2. Rather than have to call 'escaped_len()' and 'unescaped_len()' > can then allocate the required space, how about making the > `escape()' and `unescape()' functions do the space allocation > transparently? This allows the caller to just call `escape' > or `unescape()' and free the returned pointer when done. > > 3. In 'spec.c', you are calloc()ing as follows: > > --- 140,152 ---- > noparent: errx(1, "line %d: no parent node", lineno); > } > > ! if ((centry = calloc(1, sizeof(NODE) + unescaped_len(p))) == NULL) > errx(1, "calloc"); > *centry = ginfo; > > This doesn't seem to leave space for the last '0'? The original > code also has this buglet. > > If you could correct the above and submit the new patches as a > followup to this PR, it would be great. Please note that Eugene M. Kim <astralblue@usa.net> is the author of the patch, not me. I'd sent a forward of your mail to him. Regards, Slaven -- use Tk;$c=tkinit->Canvas->pack;$x=45;for(split/_/,'KPI1_+09IPK_K;-OA1_+K!;A__1; Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+KN._K+1Q!.F_1+KN.Q_+1Q__+1! KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q'){s/\n//g;for(split/!/){$c->create( 'line',map{$a=-43+ord;($x+($a>>3)*2,123+($a&7)*2)}split//)}$x+=12}MainLoop To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901061030.CAA08078>