Hi folks, I had some netnames with the character sequence "\_" in them. When saving the netlist to file, PCB was not correctly escaping them, causing syntax errors the next time the file was loaded.
This patch makes WritePCBNetListData() use PrintQuotedString() for outputting strings provided by the user. Regards, Peter -- Fisher Society committee http://tinyurl.com/o39w2 CUSBC novices, match and league secretary http://tinyurl.com/mwrc9 CU Spaceflight http://tinyurl.com/ognu2 v3sw6YChw7$ln3pr6$ck3ma8u7+Lw3+2m0l7Ci6e4+8t4Gb8en6g6Pa2Xs5Mr4p4 hackerkey.com peter-b.co.uk
pgpdLLj4ydTX6.pgp
Description: PGP signature
Correctly escape special characters when writing netlist
---
commit 4e368eebb12fd275cbde0de3845fcc577c954851
tree 9877f0632284de4d81d9800409b4788ebeddbdef
parent 21eb3ac16bf72e52e351bff6c99973e367a2645e
author Peter TB Brett <[EMAIL PROTECTED]> Sat, 16 Dec 2006 20:03:59 +0000
committer Peter TB Brett <[EMAIL PROTECTED]> Sat, 16 Dec 2006 20:03:59 +0000
pcb/src/file.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/pcb/src/file.c b/pcb/src/file.c
index 817f993..d63ca2f 100644
--- a/pcb/src/file.c
+++ b/pcb/src/file.c
@@ -575,12 +575,17 @@ WritePCBNetlistData (FILE * FP)
for (n = 0; n < PCB->NetlistLib.MenuN; n++)
{
LibraryMenuTypePtr menu = &PCB->NetlistLib.Menu[n];
- fprintf (FP, "\tNet(\"%s\" \"%s\")\n\t(\n", &menu->Name[2],
- UNKNOWN (menu->Style));
+ fprintf (FP, "\tNet(");
+ PrintQuotedString(FP, &menu->Name[2]);
+ fprintf (FP, " ");
+ PrintQuotedString(FP, UNKNOWN (menu->Style));
+ fprintf (FP, ")\n\t(\n");
for (p = 0; p < menu->EntryN; p++)
{
LibraryEntryTypePtr entry = &menu->Entry[p];
- fprintf (FP, "\t\tConnect(\"%s\")\n", entry->ListEntry);
+ fprintf (FP, "\t\tConnect(");
+ PrintQuotedString (FP, entry->ListEntry);
+ fprintf (FP, ")\n");
}
fprintf (FP, "\t)\n");
}
_______________________________________________ geda-dev mailing list [email protected] http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
