Bug 157

Summary: uniq returns only the first line
Product: Busybox Reporter: Volker Marks <volker.marks>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.13.x   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target: ARM11
Build: 1.13.2

Description Volker Marks 2009-03-09 08:52:30 UTC
The "uniq" command returns (at least on ARM) only the first line of the input.

Reason: In "uniq_main" the variable "max_chars" is being initialized with -1. Then this variable is being passed to "strncmp". 

Quickfix: After changing "strncmp" to "strcmp" it works fine again...
Comment 1 Denys Vlasenko 2009-03-09 16:43:46 UTC
Does it work for you if you replace -1 with INT_MAX?
Comment 2 Volker Marks 2009-03-10 09:53:44 UTC
(In reply to comment #1)
> Does it work for you if you replace -1 with INT_MAX?
> 

Haven't tried it, but I'm pretty sure that it will also work as strncmp is basically working on our system...