From 3a7c9e2bfbff587b78632bd147a60150a9976b18 Mon Sep 17 00:00:00 2001
From: Young Mo Kang <kym327@gmail.com>
Date: Sun, 28 Feb 2016 16:51:08 -0500
Subject: [PATCH 6/7] Modify pred->p_name for -type and -xtype

* find/parser.c (insert_type): Modify pred->p_name here instead from
tree.c's build_expression function.
---
 find/parser.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/find/parser.c b/find/parser.c
index 2556864..a9b688e 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -2801,9 +2801,8 @@ insert_type (char **argv, int *arg_ptr,
 	  }
     /* NOTE: the arg_text field will not be a single char unless the last one.
     To fix it, one will need to go through the hassle of allocating and freeing memory, because pred->arg_text is just a string pointer to argv[].
-    Note sure if the fix is necessary */
+    Not sure if the fix is necessary */
     our_pred = insert_primary_withpred (entry, which_pred, &typeletter[i]);
-    our_pred->p_name = "-type";     /* otherwise, its p_name will be "type" */
 	our_pred->est_success_rate = rate;
 
 	/* Figure out if we will need to stat the file, because if we don't
@@ -2814,11 +2813,13 @@ insert_type (char **argv, int *arg_ptr,
 	  {
 	    our_pred->need_stat = true;
 	    our_pred->need_type = false;
+            our_pred->p_name = "-xtype";
 	  }
 	else
 	  {
 	    our_pred->need_stat = false; /* struct dirent is enough */
 	    our_pred->need_type = true;
+            our_pred->p_name = "-type";
 	  }
 	our_pred->args.type = type_cell;
 			if (typeletter_length == 1)
-- 
2.7.0

