Fixed horrible brokenness
authorewt <devnull@localhost>
Tue, 3 Jun 1997 16:08:23 +0000 (16:08 +0000)
committerewt <devnull@localhost>
Tue, 3 Jun 1997 16:08:23 +0000 (16:08 +0000)
CVS patchset: 1681
CVS date: 1997/06/03 16:08:23

misc/getmntent.c
misc/miscfn.h

index 69eb188..c1506c6 100644 (file)
 #define COMMENTCHAR '#'
 #endif
 
-struct mntent *getmntent(FILE *filep) {
-    static struct mntent item = { NULL };
+our_mntent *getmntent(FILE *filep) {
+    static our_mntent item = { NULL };
     char buf[1024], * start;
     char * chptr;
 
-    if (item.mnt_dir) {
-       free(item.mnt_dir);
+    if (item.our_mntdir) {
+       free(item.our_mntdir);
     }
     
     while (fgets(buf, sizeof(buf) - 1, filep)) {
@@ -49,7 +49,7 @@ struct mntent *getmntent(FILE *filep) {
            while (!isspace(*chptr) && (*chptr)) chptr++;
            *chptr = '\0';
 
-           item.mnt_dir = strdup(start);
+           item.our_mntdir = strdup(start);
            return &item;
        #endif
     }
index adabc77..b943321 100644 (file)
@@ -65,17 +65,18 @@ extern void *myrealloc(void *, size_t);
 #if HAVE_MNTENT_H || !(HAVE_GETMNTENT)
 # if HAVE_MNTENT_H
 #  include <mntent.h>
+#  define our_mntent struct mntent
+#  define our_mntdir mnt_dir
 # else
    #include <stdio.h>
-   struct mntent {
-       char * mnt_dir;
+   struct our_mntent {
+       char * our_mntdir;
    };
-   struct mntent *getmntent(FILE *filep);
+   struct our_mntent *getmntent(FILE *filep);
+#  define our_mntent struct our_mntent
 # endif
 # define GETMNTENT_ONE 1
 # define GETMNTENT_TWO 0
-# define our_mntent struct mntent
-# define our_mntdir mnt_dir
 #elif HAVE_SYS_MNTTAB_H
 # include <stdio.h>
 # include <sys/mnttab.h>