Re: [PATCH] Remove isys/minifind.c and isys/minifind.h

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

 



ACK!

On 03/05/2010 05:21 AM, David Cantrell wrote:
Remove unused code from isys.
---
  isys/Makefile.am |    4 ---
  isys/minifind.c  |   77 ------------------------------------------------------
  isys/minifind.h  |   42 -----------------------------
  3 files changed, 0 insertions(+), 123 deletions(-)
  delete mode 100644 isys/minifind.c
  delete mode 100644 isys/minifind.h

diff --git a/isys/Makefile.am b/isys/Makefile.am
index 32ba64c..deebabc 100644
--- a/isys/Makefile.am
+++ b/isys/Makefile.am
@@ -21,10 +21,6 @@ ISYS_SRCS = devices.c imount.c cpio.c uncpio.c lang.c \
              isofs.c linkdetect.c vio.c ethtool.c eddsupport.c iface.c \
              str.c auditd.c

-if IS_PPC
-ISYS_SRCS += minifind.c
-endif
-
  dist_noinst_HEADERS = *.h

  ISYS_CFLAGS = -DVERSION='"$(PACKAGE_VERSION)"' $(NFS_CFLAGS) \
diff --git a/isys/minifind.c b/isys/minifind.c
deleted file mode 100644
index f483055..0000000
--- a/isys/minifind.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* minifind.c -- simple find library
- *
- * Copyright (c) 2002 Terra Soft Solutions, Inc.
- * Written by Dan Burcaw<dburcaw@xxxxxxxxxxxxxxxxxxxxxx>
- *
- * This software may be freely redistributed under the terms of the GNU
- * library public license.
- *
- * You should have received a copy of the GNU Library Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "minifind.h"
-
-// insert a node at head of linked-list
-void insert_node(struct pathNode *n, char *path)
-{
-  	struct pathNode *new = (struct pathNode *) malloc(sizeof(struct pathNode));
-  	new->path = path;
-  	new->next = n->next;
-  	n->next = new;
-}
-
-// return input strip less last character
-char *stripLastChar(char *in)
-{
-	char *out = malloc(sizeof(char)*strlen(in));
-	snprintf(out, strlen(in) - 1, "%s", in);
-	return out;
-}
-
-// do the work
-char *minifind(char *dir, char *search, struct findNode *list)
-{
-  	char *d = NULL;
-  	int n;
-  	struct dirent **namelist;
-  	struct stat buf;
-
-  	if (dir[strlen(dir)-1] == '/')
-	  	dir = stripLastChar(dir);
-
-	// check is there is an exact filematch to dir
-	// when search is not specified
-	if (search == NULL)
-	{
-		if (lstat(dir,&buf) == 0)
-			insert_node(list->result, dir);
-		return 0;
-	}
-
-  	n = scandir(dir,&namelist, 0, alphasort);
-  	if (n>= 0)
-  	{
-      		while (n--)
-      		{
-          		d = malloc(sizeof(char) * (strlen(dir) \
-						+ strlen(namelist[n]->d_name)+1));
-          		sprintf(d, "%s/%s", dir, namelist[n]->d_name);	
-			if (strstr(namelist[n]->d_name, search))
-		      		insert_node(list->result, d);
-
-          		if ((lstat(d,&buf) == 0)&&  S_ISDIR(buf.st_mode))
-          		{
-              			if (strcmp(namelist[n]->d_name, ".")&&
-                  			strcmp(namelist[n]->d_name, ".."))
-	          			d = minifind(d, search, list);
-          		}
-      			free(namelist[n]);
-      		}
-  		free(namelist);
-  		return d;
-  	}
-  	return 0;
-}
diff --git a/isys/minifind.h b/isys/minifind.h
deleted file mode 100644
index 4f72525..0000000
--- a/isys/minifind.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* minifind.h
- *
- * Copyright (c) 2002 Terra Soft Solutions, Inc.
- * Written by Dan Burcaw<dburcaw@xxxxxxxxxxxxxxxxxxxxxx>
- *
- * This software may be freely redistributed under the terms of the GNU
- * library public license.
- *
- * You should have received a copy of the GNU Library Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef MINIFIND_H
-#define MINIFIND_H
-
-#include<stdio.h>
-#include<string.h>
-#include<dirent.h>
-#include<malloc.h>
-#include<unistd.h>
-#include<sys/stat.h>
-#include<sys/types.h>
-
-struct pathNode
-{
-  char *path;
-  struct pathNode *next;
-};
-
-struct findNode
-{
-  struct pathNode *result;
-  struct pathNode *exclude;
-};
-
-void insert_node(struct pathNode *n, char *path);
-char *stripLastChar(char *in);
-char *minifind(char *dir, char *search, struct findNode *list);
-
-#endif /* MINIFIND_H */

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux