X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f Date: Sat, 17 Mar 2012 13:16:20 -0400 Message-Id: <201203171716.q2HHGKBO032473@envy.delorie.com> From: DJ Delorie To: geda-user AT delorie DOT com In-reply-to: (message from Sergey Alyoshin on Sat, 17 Mar 2012 16:07:35 +0300) Subject: Re: [geda-user] very old .pcb file References: <20321 DOT 59968 DOT 314778 DOT 216654 AT vagabond DOT local> <20120316194917 DOT GA28072 AT malakian DOT lan> Reply-To: geda-user AT delorie DOT com > With following patch, file http://661.org/tmp/ramcard.pcb can be > opened in pcb from git. > Is it acceptable? Would it be better to make up a name, like "Layer%d" ? Are we sure strdup() is the right thing to do? > diff --git a/src/parse_y.y b/src/parse_y.y > index 2ae9f6c..22d02cc 100644 > --- a/src/parse_y.y > +++ b/src/parse_y.y > @@ -863,6 +863,8 @@ layer > > /* memory for name is already allocated */ > Layer->Name = $4; > + if (Layer->Name == NULL) > + Layer->Name = strdup(""); > LayerFlag[$3-1] = true; > if (yyData->LayerN + 2 < $3) > yyData->LayerN = $3 - 2; >