Revision: 42062
http://brlcad.svn.sourceforge.net/brlcad/?rev=42062&view=rev
Author: johnranderson
Date: 2011-01-10 21:28:19 +0000 (Mon, 10 Jan 2011)
Log Message:
-----------
Now accepts initial comments at start of file
First non-comment non-blank line must still be a "title" or "put" command,
Modified Paths:
--------------
brlcad/trunk/src/conv/asc/asc2g.c
Modified: brlcad/trunk/src/conv/asc/asc2g.c
===================================================================
--- brlcad/trunk/src/conv/asc/asc2g.c 2011-01-10 20:24:10 UTC (rev 42061)
+++ brlcad/trunk/src/conv/asc/asc2g.c 2011-01-10 21:28:19 UTC (rev 42062)
@@ -1700,6 +1700,7 @@
struct bu_vls str_title;
struct bu_vls str_put;
struct bu_vls line;
+ int isComment=1;
bu_debug = BU_DEBUG_COREDUMP;
@@ -1726,10 +1727,29 @@
bu_vls_init(&str_put);
bu_vls_strcpy( &str_put, "put ");
- if (bu_vls_gets(&line, ifp) < 0) {
- fclose(ifp); ifp = NULL;
- wdb_close(ofp); ofp = NULL;
- bu_exit(1, "Unexpected EOF\n");
+ while (isComment) {
+ char *str;
+ int charIndex;
+ int len;
+ bu_vls_trunc2(&line, 0);
+ if (bu_vls_gets(&line, ifp) < 0) {
+ fclose(ifp); ifp = NULL;
+ wdb_close(ofp); ofp = NULL;
+ bu_exit(1, "Unexpected EOF\n");
+ }
+ str = bu_vls_addr(&line);
+ len = strlen(str);
+ for (charIndex=0 ; charIndex<len ; charIndex++) {
+ if (str[charIndex] == '#') {
+ isComment = 1;
+ break;
+ } else if (isspace(str[charIndex])) {
+ continue;
+ } else {
+ isComment = 0;
+ break;
+ }
+ }
}
/* new style ascii database */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web. Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits