Package: dc
Version: 1.06.95-2
Followup-For: Bug #582137

This is a regression. Terran Melconian <ter...@consistent.org> provided
patches in bug #167274 to implement .dcrc and the -E command line
option, wich were applied in version 1.06-9 .

The 1.06.94-1 debian changelog entry notes:
* Upstream has removed the '-E' option.

My guess is that the .dcrc handling got lost there as well.

Please reinstate it, unless upstream disagrees with that as well.
In that case, please remove the (debian-specific) manpage patch
mentioning .dcrc .

Attached ist Terran's .dcrc patch again, slightly modified for
1. moving reading the rcfile to before argument processing, and
2. changed line numbers/context

Rationale for #1 is that I think
$ dc
$ dc -
$ dc -f -
should all behave the same.

regards,
    Jan

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (99, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dc depends on:
ii  dpkg                      1.15.8.10      Debian package management system
ii  install-info              4.13a.dfsg.1-6 Manage installed documentation in 
ii  libc6                     2.11.2-11      Embedded GNU C Library: Shared lib

dc recommends no packages.

dc suggests no packages.

-- no debconf information

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
diff -ur bc-1.06.95.old//dc/dc.c bc-1.06.95/dc/dc.c
--- bc-1.06.95.old//dc/dc.c	2009-10-05 01:00:07.000000000 +0200
+++ bc-1.06.95/dc/dc.c	2011-03-19 23:12:32.000000000 +0100
@@ -45,6 +45,8 @@
 # include <sys/stat.h>
 #endif
 #include <getopt.h>
+#include <pwd.h>
+#include <unistd.h>
 #include "dc.h"
 #include "dc-proto.h"
 
@@ -245,6 +247,29 @@
 	return r;
 }
 
+static void
+try_rcfile(void)
+{
+    char *homedir;
+    struct passwd *pw;
+    char *rcfile;
+    FILE *input;
+
+    homedir=getenv("HOME");
+    if (!homedir)
+    {
+	pw=getpwuid(getuid());
+	homedir=pw->pw_dir;
+    }
+    rcfile=malloc(strlen(homedir)+8);
+    sprintf(rcfile, "%s/.dcrc", homedir);
+    if (!(input=fopen(rcfile, "r")))
+	return;
+    if (dc_evalfile(input))
+	exit(EXIT_FAILURE);
+    fclose(input);
+}
+
 
 int
 main DC_DECLARG((argc, argv))
@@ -271,6 +296,8 @@
 	dc_register_init();
 	dc_array_init();
 
+	try_rcfile();
+
 	while ((c = getopt_long(argc, argv, "hVe:f:", long_opts, (int *)0)) != EOF) {
 		switch (c) {
 		case 'e':

Attachment: signature.asc
Description: Digital signature

Reply via email to