diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index 3bec8cf..7c5a5de 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -20,11 +20,11 @@
 
 extern int dpkg_deb_main(int argc, char **argv)
 {
-	char *target_dir;
+	char *argument = NULL;
 	int opt = 0;
 	int optflag = 0;	
 	
-	while ((opt = getopt(argc, argv, "cetXxl")) != -1) {
+	while ((opt = getopt(argc, argv, "ceftXxI")) != -1) {
 		switch (opt) {
 			case 'c':
 				optflag |= extract_contents;
@@ -32,6 +32,9 @@
 			case 'e':
 				optflag |= extract_control;
 				break;
+			case 'f':
+				optflag |= extract_field;
+				break;
 			case 't':
 				optflag |= extract_fsys_tarfile;
 				break;
@@ -41,13 +44,9 @@
 			case 'x':
 				optflag |= extract_extract;
 				break;
-			case 'l':
-				optflag |= extract_list;
-				break;
-/*			case 'I':
+			case 'I':
 				optflag |= extract_info;
 				break;
-*/
 			default:
 				show_usage();
 		}
@@ -61,26 +60,33 @@
 		case (extract_control):
 		case (extract_extract):
 		case (extract_verbose_extract):
+			/* argument is a dir name */
 			if ( (optind + 1) == argc ) {
-				target_dir = (char *) xmalloc(7);
-				strcpy(target_dir, "DEBIAN");
+				argument = xstrdup("DEBIAN");
 			} else {
-				target_dir = (char *) xmalloc(strlen(argv[optind + 1]) + 1);
-				strcpy(target_dir, argv[optind + 1]);
+				argument = xstrdup(argv[optind + 1]);
 			}
 			break;
+		case (extract_field):
+			/* argument is a control field name */
+			if ((optind + 1) != argc) {
+				argument = xstrdup(argv[optind + 1]);				
+			}
+			break;
+		case (extract_info):
+			/* argument is a control field name */
+			if ((optind + 1) != argc) {
+				argument = xstrdup(argv[optind + 1]);
+				break;
+			} else {
+				error_msg("-I currently requires a filename to be specifies");
+				return(EXIT_FAILURE);
+			}
+			/* argument is a filename */
 		default:
-			target_dir = NULL;
 	}
 
-	deb_extract(argv[optind], optflag, target_dir);
-/*	else if (optflag & dpkg_deb_info) {
-		extract_flag = TRUE;
-		extract_to_stdout = TRUE;
-		strcpy(ar_filename, "control.tar.gz");
-		extract_list = argv+optind+1;
-		printf("list one is [%s]\n",extract_list[0]);
-	}
-*/
+	deb_extract(argv[optind], optflag, argument);
+
 	return(EXIT_SUCCESS);
 }
diff --git a/dpkg_deb.c b/dpkg_deb.c
index 3bec8cf..7c5a5de 100644
--- a/dpkg_deb.c
+++ b/dpkg_deb.c
@@ -20,11 +20,11 @@
 
 extern int dpkg_deb_main(int argc, char **argv)
 {
-	char *target_dir;
+	char *argument = NULL;
 	int opt = 0;
 	int optflag = 0;	
 	
-	while ((opt = getopt(argc, argv, "cetXxl")) != -1) {
+	while ((opt = getopt(argc, argv, "ceftXxI")) != -1) {
 		switch (opt) {
 			case 'c':
 				optflag |= extract_contents;
@@ -32,6 +32,9 @@
 			case 'e':
 				optflag |= extract_control;
 				break;
+			case 'f':
+				optflag |= extract_field;
+				break;
 			case 't':
 				optflag |= extract_fsys_tarfile;
 				break;
@@ -41,13 +44,9 @@
 			case 'x':
 				optflag |= extract_extract;
 				break;
-			case 'l':
-				optflag |= extract_list;
-				break;
-/*			case 'I':
+			case 'I':
 				optflag |= extract_info;
 				break;
-*/
 			default:
 				show_usage();
 		}
@@ -61,26 +60,33 @@
 		case (extract_control):
 		case (extract_extract):
 		case (extract_verbose_extract):
+			/* argument is a dir name */
 			if ( (optind + 1) == argc ) {
-				target_dir = (char *) xmalloc(7);
-				strcpy(target_dir, "DEBIAN");
+				argument = xstrdup("DEBIAN");
 			} else {
-				target_dir = (char *) xmalloc(strlen(argv[optind + 1]) + 1);
-				strcpy(target_dir, argv[optind + 1]);
+				argument = xstrdup(argv[optind + 1]);
 			}
 			break;
+		case (extract_field):
+			/* argument is a control field name */
+			if ((optind + 1) != argc) {
+				argument = xstrdup(argv[optind + 1]);				
+			}
+			break;
+		case (extract_info):
+			/* argument is a control field name */
+			if ((optind + 1) != argc) {
+				argument = xstrdup(argv[optind + 1]);
+				break;
+			} else {
+				error_msg("-I currently requires a filename to be specifies");
+				return(EXIT_FAILURE);
+			}
+			/* argument is a filename */
 		default:
-			target_dir = NULL;
 	}
 
-	deb_extract(argv[optind], optflag, target_dir);
-/*	else if (optflag & dpkg_deb_info) {
-		extract_flag = TRUE;
-		extract_to_stdout = TRUE;
-		strcpy(ar_filename, "control.tar.gz");
-		extract_list = argv+optind+1;
-		printf("list one is [%s]\n",extract_list[0]);
-	}
-*/
+	deb_extract(argv[optind], optflag, argument);
+
 	return(EXIT_SUCCESS);
 }
diff --git a/include/libbb.h b/include/libbb.h
index bc8e3c5..515bf27 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -235,10 +235,11 @@
 	extract_extract = 8,
 	extract_verbose_extract = 16,
 	extract_list = 32,
-	extract_fsys_tarfile = 64
+	extract_fsys_tarfile = 64,
+	extract_field = 128
 } extract_function_t;
 extern int deb_extract(const char *package_filename, int function, char *target_dir);
-extern int untar(FILE *src_tar_file, int untar_function, char *base_path);
+extern int untar(FILE *src_tar_file, const int untar_function, const char *argument);
 
 extern int unzip(FILE *l_in_file, FILE *l_out_file);
 extern void gz_close(int gunzip_pid);
diff --git a/libbb/deb_extract.c b/libbb/deb_extract.c
index d3e6153..0f5a570 100644
--- a/libbb/deb_extract.c
+++ b/libbb/deb_extract.c
@@ -30,7 +30,11 @@
 #include <signal.h>
 #include "libbb.h"
 
-extern int deb_extract(const char *package_filename, int function, char *target_dir)
+/*
+ * The contents of argument depend on the value of function.
+ * It is either a dir name or a control file or field name(see dpkg_deb.c)
+ */
+extern int deb_extract(const char *package_filename, int function, char *argument)
 {
 
 	FILE *deb_file, *uncompressed_file;
@@ -41,6 +45,7 @@
 	switch (function) {
 		case (extract_info):
 		case (extract_control):
+		case (extract_field):
 			ared_file = xstrdup("control.tar.gz");
 			break;
 		default:
@@ -70,7 +75,7 @@
 	if (function & extract_fsys_tarfile) {
 		copy_file_chunk(uncompressed_file, stdout, -1);
 	} else {
-		untar(uncompressed_file, function, target_dir);
+		untar(uncompressed_file, function, argument);
 	}
 	/* we are deliberately terminating the child so we can safely ignore this */
 	gz_close(gunzip_pid);
diff --git a/libbb/libbb.h b/libbb/libbb.h
index bc8e3c5..515bf27 100644
--- a/libbb/libbb.h
+++ b/libbb/libbb.h
@@ -235,10 +235,11 @@
 	extract_extract = 8,
 	extract_verbose_extract = 16,
 	extract_list = 32,
-	extract_fsys_tarfile = 64
+	extract_fsys_tarfile = 64,
+	extract_field = 128
 } extract_function_t;
 extern int deb_extract(const char *package_filename, int function, char *target_dir);
-extern int untar(FILE *src_tar_file, int untar_function, char *base_path);
+extern int untar(FILE *src_tar_file, const int untar_function, const char *argument);
 
 extern int unzip(FILE *l_in_file, FILE *l_out_file);
 extern void gz_close(int gunzip_pid);
diff --git a/libbb/untar.c b/libbb/untar.c
index d3e424e..b768c0b 100644
--- a/libbb/untar.c
+++ b/libbb/untar.c
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include "libbb.h"
 
-extern int untar(FILE *src_tar_file, int untar_function, char *base_path)
+extern int untar(FILE *src_tar_file, const int untar_function, const char *argument)
 {
 	typedef struct raw_tar_header {
         char name[100];               /*   0-99 */
@@ -101,37 +101,18 @@
 		if (size % 512 != 0) {
 			next_header_offset += (512 - size % 512);
 		}
-		/*
-		 * seek to start of control file, return length
-		 *
-		if (dpkg_untar_function & dpkg_untar_seek_control) {
-			if ((raw_tar_header.typeflag == '0') || (raw_tar_header.typeflag == '\0')) {
-				char *tar_filename;
 
-				tar_filename = strrchr(raw_tar_header.name, '/');
-				if (tar_filename == NULL) {
-					tar_filename = strdup(raw_tar_header.name);
-				} else {
-					tar_filename++;
-				}
-
-				if (strcmp(tar_filename, "control") == 0) {
-					return(size);
-				}
-			}
-
-		}
-*/
 		if (untar_function & (extract_contents | extract_verbose_extract)) {
 			printf("%s\n", raw_tar_header.name);
 		}
 
 		/* extract files */
-		if (base_path != NULL) {
-			dir = xmalloc(strlen(raw_tar_header.name) + strlen(base_path) + 2);
-			sprintf(dir, "%s/%s", base_path, raw_tar_header.name);
+		if (untar_function & (extract_extract | extract_verbose_extract | extract_control)) {
+			dir = xmalloc(strlen(raw_tar_header.name) + strlen(argument) + 2);
+			sprintf(dir, "%s/%s", argument, raw_tar_header.name);
 			create_path(dir, 0777);
 		}
+
 		switch (raw_tar_header.typeflag ) {
 			case '0':
 			case '\0':
@@ -145,14 +126,28 @@
 						uncompressed_count += size;
 						fclose(dst_file);
 					}
-					while (uncompressed_count < next_header_offset) {
-						if (fgetc(src_tar_file) == EOF) {
-							perror_msg("untar");
-							break;
+					else if (untar_function & extract_info) {
+						if (strstr(raw_tar_header.name, argument) != NULL) {
+							copy_file_chunk(src_tar_file, stdout, (unsigned long long) size);
+							uncompressed_count += size;
 						}
-						uncompressed_count++;
 					}
-					uncompressed_count += size;
+					else if (untar_function & extract_field) {
+						if (strstr(raw_tar_header.name, "./control") != NULL) {
+							char *line;
+							while ((line = get_line_from_file(src_tar_file)) != NULL) {
+								uncompressed_count += strlen(line);
+								if (argument == NULL) {
+									printf("%s",line);
+								}
+								else if (strncmp(line, argument, strlen(argument)) == 0) {
+									char *file_ptr;
+									file_ptr = strstr(line, ": ");
+									printf("%s", file_ptr + 2);
+								}
+ 							}
+						}
+					}
 					break;
 				}
 			case '5':
@@ -193,6 +188,17 @@
 				free(dir);
 				return(EXIT_FAILURE);
 		}
+
+		/*
+		 * Seek to start of next block, cant use fseek as unzip() does support it
+		 */
+		while (uncompressed_count < next_header_offset) {
+			if (fgetc(src_tar_file) == EOF) {
+				break;
+			}
+			uncompressed_count++;
+		}
+
 //		free(dir);
 	}
 	return(EXIT_SUCCESS);
