BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000697 [BusyBox] New Features feature always 02-07-06 07:58 02-08-06 06:21
Reporter nawawi View Status public  
Assigned To BusyBox
Priority none Resolution no change required  
Status closed   Product Version svn
Summary 0000697: ash strstr command built-in
Description add c-syntax strstr feature to ash shell.
if success return 1 else return 0.

example:

if strstr "i like cat" "cat"; then
  echo "found cat"
fi

strstr "i like cat" "cat"
if [ $? = 1 ]; then
 echo "found cat"
fi
Additional Information
Attached Files  ash.c.patch [^] (1,112 bytes) 02-07-06 07:58
 ash.c-2.patch [^] (1,062 bytes) 02-07-06 22:38

- Relationships

- Notes
(0001059)
vodz
02-07-06 08:05

My bash have not this builtins command.
Also. You really sure use putchar('0') vs printf("0\n")?
 
(0001063)
nawawi
02-07-06 22:49

i've fixed it only return value

if success return 0 else return 1.
eg;

if strstr "this is test" "test" ;then
  echo "found - return $?"
fi

if strstr "this is test" "testss" ;then
        echo "found - return $?"
else
  echo "not found - return $?"

fi
 
(0001064)
vodz
02-08-06 01:27

>> My bash have not this builtins command.

>this function use for busybox ash shell you can test with busybox ash enabled

;-)

I wished to tell, that it would be strange to add an featute to ash
which is absent in more greater and bloated shell: bash.
 
(0001065)
nawawi
02-08-06 05:20

:) its ok.. im just plan to put some simple function to ash for string manipulation.. like strstr,strtok, that not much effect to size.
 
(0001066)
vodz
02-08-06 06:21

Ok? Ok! Closed.
 

- Issue History
Date Modified Username Field Change
02-07-06 07:58 nawawi New Issue
02-07-06 07:58 nawawi Status new => assigned
02-07-06 07:58 nawawi Assigned To  => BusyBox
02-07-06 07:58 nawawi File Added: ash.c.patch
02-07-06 08:05 vodz Note Added: 0001059
02-07-06 10:16 nawawi Note Added: 0001060
02-07-06 22:18 nawawi Note Deleted: 0001060
02-07-06 22:38 nawawi File Added: ash.c-2.patch
02-07-06 22:49 nawawi Note Added: 0001063
02-08-06 01:27 vodz Note Added: 0001064
02-08-06 05:20 nawawi Note Added: 0001065
02-08-06 06:21 vodz Note Added: 0001066
02-08-06 06:21 vodz Priority normal => none
02-08-06 06:21 vodz Status assigned => closed
02-08-06 06:21 vodz Resolution open => no change required


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker