replace: count_strstr - Handle an edge case where sub is empty
authorMartin Lewis <martin.lewis.x84@gmail.com>
Sun, 15 Sep 2019 16:51:30 +0000 (18:51 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 9 Oct 2019 12:39:41 +0000 (14:39 +0200)
commit7011eca83afc313098f9869eea36742d4506bc02
treefc6d769828c261edb562a372d61c14142d5f32d0
parentdd4686128290b34d61becaaba88c54d5213f7aa5
replace: count_strstr - Handle an edge case where sub is empty

If sub is empty, avoids an infinite loop.

function                                             old     new   delta
count_strstr                                          45      63     +18

Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/replace.c