[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: pcb option --fab-author not working
(sorry, this is off-topic)
diff --git a/src/misc.c b/src/misc.c
index 693da81..89d5c84 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1836,18 +1836,18 @@ LayerGroupsToString (LayerGroupTypePtr lg)
char *
pcb_author (void)
{
-#ifdef HAVE_GETPWUID
- static struct passwd *pwentry;
static char *fab_author = 0;
if (!fab_author)
{
if (Settings.FabAuthor && Settings.FabAuthor[0])
fab_author = Settings.FabAuthor;
+#ifdef HAVE_GETPWUID
else
{
int len;
char *comma, *gecos;
+ static struct passwd *pwentry;
/* ID the user. */
pwentry = getpwuid (getuid ());
@@ -1857,20 +1857,15 @@ pcb_author (void)
len = comma - gecos;
else
len = strlen (gecos);
- fab_author = malloc (len + 1);
- if (!fab_author)
- {
- perror ("pcb: out of memory.\n");
- exit (-1);
- }
+ fab_author = MyMalloc (len + 1, "pcb_author");
memcpy (fab_author, gecos, len);
fab_author[len] = 0;
}
+#endif
}
- return fab_author;
-#else
+ if (fab_author)
+ return fab_author;
return "Unknown";
-#endif
}
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user