nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] nmh ./ChangeLog h/utils.h sbr/Makefile.in sbr/u...


From: Josh Bressers
Subject: [Nmh-commits] nmh ./ChangeLog h/utils.h sbr/Makefile.in sbr/u...
Date: Tue, 03 Jan 2006 01:08:33 +0000

CVSROOT:        /sources/nmh
Module name:    nmh
Branch:         
Changes by:     Josh Bressers <address@hidden>  06/01/03 01:08:33

Modified files:
        .              : ChangeLog 
        h              : utils.h 
        sbr            : Makefile.in utils.c 
Removed files:
        sbr            : pwd.c 

Log message:
        Remove sbr/pwd.c file, moving the pwd() function into sbr/utils.c.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/nmh/ChangeLog.diff?tr1=1.219&tr2=1.220&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/nmh/nmh/h/utils.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/nmh/nmh/sbr/Makefile.in.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/nmh/nmh/sbr/utils.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: nmh/ChangeLog
diff -u nmh/ChangeLog:1.219 nmh/ChangeLog:1.220
--- nmh/ChangeLog:1.219 Mon Jan  2 03:25:18 2006
+++ nmh/ChangeLog       Tue Jan  3 01:08:33 2006
@@ -1,3 +1,7 @@
+2006-01-02  Josh Bressers <address@hidden>
+
+       * Remove sbr/pwd.c file, moving the pwd() function into sbr/utils.c.
+
 2006-01-01  Josh Bressers <address@hidden>
 
        * patch #3967: Create a mh_xrealloc function to prevent mistakes when
Index: nmh/h/utils.h
diff -u nmh/h/utils.h:1.2 nmh/h/utils.h:1.3
--- nmh/h/utils.h:1.2   Mon Jan  2 03:25:18 2006
+++ nmh/h/utils.h       Tue Jan  3 01:08:33 2006
@@ -2,8 +2,9 @@
 /*
  * utils.h -- utility prototypes
  *
- * $Id: utils.h,v 1.2 2006/01/02 03:25:18 bress Exp $
+ * $Id: utils.h,v 1.3 2006/01/03 01:08:33 bress Exp $
  */
 
 void *mh_xmalloc(size_t);
 void *mh_xrealloc(void *, size_t);
+char *pwd(void);
Index: nmh/sbr/Makefile.in
diff -u nmh/sbr/Makefile.in:1.21 nmh/sbr/Makefile.in:1.22
--- nmh/sbr/Makefile.in:1.21    Mon Jan  2 03:17:42 2006
+++ nmh/sbr/Makefile.in Tue Jan  3 01:08:33 2006
@@ -1,7 +1,7 @@
 #
 # Makefile for sbr subdirectory
 #
-# $Id: Makefile.in,v 1.21 2006/01/02 03:17:42 bress Exp $
+# $Id: Makefile.in,v 1.22 2006/01/03 01:08:33 bress Exp $
 #
 
 SHELL = /bin/sh
@@ -68,7 +68,7 @@
        makedir.c mts.c norm_charmap.c                                  \
        path.c peekc.c pidwait.c pidstatus.c                            \
        print_help.c print_sw.c print_version.c push.c                  \
-       putenv.c pwd.c refile.c remdir.c r1bindex.c                     \
+       putenv.c refile.c       remdir.c r1bindex.c                     \
        readconfig.c ruserpass.c seq_add.c seq_bits.c                   \
        seq_del.c seq_getnum.c seq_list.c seq_nameok.c                  \
        seq_print.c seq_read.c seq_save.c seq_setcur.c                  \
Index: nmh/sbr/utils.c
diff -u nmh/sbr/utils.c:1.2 nmh/sbr/utils.c:1.3
--- nmh/sbr/utils.c:1.2 Mon Jan  2 03:25:18 2006
+++ nmh/sbr/utils.c     Tue Jan  3 01:08:33 2006
@@ -2,14 +2,14 @@
 /*
  * utils.c -- various utility routines
  *
- * $Id: utils.c,v 1.2 2006/01/02 03:25:18 bress Exp $
+ * $Id: utils.c,v 1.3 2006/01/03 01:08:33 bress Exp $
  *
  * This code is Copyright (c) 2006, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
  */
 
-#include <h/nmh.h>
+#include <h/mh.h>
 #include <h/utils.h>
 #include <stdlib.h>
 
@@ -42,3 +42,24 @@
 
     return memory;
 }
+char *
+pwd(void)
+{
+    register char *cp;
+    static char curwd[PATH_MAX];
+
+    if (!getcwd (curwd, PATH_MAX)) {
+        admonish (NULL, "unable to determine working directory");
+        if (!mypath || !*mypath
+                || (strcpy (curwd, mypath), chdir (curwd)) == -1) {
+            strcpy (curwd, "/");
+            chdir (curwd);
+        }
+        return curwd;
+    }
+
+    if ((cp = curwd + strlen (curwd) - 1) > curwd && *cp == '/')
+        *cp = '\0';
+
+    return curwd;
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]