Revision: 55316
          http://sourceforge.net/p/brlcad/code/55316
Author:   carlmoore
Date:     2013-05-07 16:44:01 +0000 (Tue, 07 May 2013)
Log Message:
-----------
implement progname in outputs

Modified Paths:
--------------
    brlcad/trunk/src/sig/dmod.c

Modified: brlcad/trunk/src/sig/dmod.c
===================================================================
--- brlcad/trunk/src/sig/dmod.c 2013-05-07 16:33:00 UTC (rev 55315)
+++ brlcad/trunk/src/sig/dmod.c 2013-05-07 16:44:01 UTC (rev 55316)
@@ -37,6 +37,9 @@
 #include "vmath.h"
 
 
+char *progname = "dmod";
+
+
 char   *file_name = NULL;
 FILE   *infp = NULL;
 
@@ -78,7 +81,7 @@
                op[ numop ] = MULT;
                d = atof(bu_optarg);
                if (ZERO(d)) {
-                   bu_exit(2, "dmod: divide by zero!\n");
+                   bu_exit(2, "%s: divide by zero!\n",progname);
                }
                val[ numop++ ] = 1.0 / d;
                break;
@@ -94,7 +97,7 @@
                op[ numop ] = POW;
                d = atof(bu_optarg);
                if (ZERO(d)) {
-                   bu_exit(2, "dmod: zero root!\n");
+                   bu_exit(2, "%s: zero root!\n",progname);
                }
                val[ numop++ ] = 1.0 / d;
                break;
@@ -113,14 +116,14 @@
        file_name = argv[bu_optind];
        if ( (infp = fopen(file_name, "r")) == NULL )  {
            fprintf( stderr,
-                          "dmod: cannot open \"%s\" for reading\n",
-                          file_name );
+                          "%s: cannot open \"%s\" for reading\n",
+                          progname,file_name );
            return 0;
        }
     }
 
     if (argc > ++bu_optind)
-       fprintf(stderr, "dmod: excess argument(s) ignored\n");
+       fprintf(stderr, "%s: excess argument(s) ignored\n",progname);
 
     return 1;          /* OK */
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to