My question involves police conduct in the State of: Texas
Scenario:
Pulled over at 12.00 at night
When pulled over the Officer asked what I was doing.
I told him what my plans were.
He then asked me to get out of the vehicle.
he began searching the car.
He opened my glove compartment and found my knife.
Claiming it was 5 inches long (guesstimate with thumb to palm of hand (which is in no way a definitive measurement)
Confiscated it and wrote my ticket.
My question is.
Was he lawfully capable of searching my glove compartment without a warrant. Often I have been told that they can only search what is within sight.
Thanks in advance.

