ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* Busyboxed by Denis Vlasenko <vda.linux@googlemail.com> */
+/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
/* Collected into one file from runit's many tiny files */
/* TODO: review, eliminate unneeded stuff, move good stuff to libbb */
#include "libbb.h"
#include "runit_lib.h"
+#ifdef UNUSED
unsigned byte_chr(char *s,unsigned n,int c)
{
char ch;
return t - s;
}
-int coe(int fd)
-{
- return fcntl(fd, F_SETFD, FD_CLOEXEC);
-}
-
-#ifdef UNUSED
static /* as it isn't used anywhere else */
void tai_pack(char *s, const struct tai *t)
{
if (!c) return !len;
switch (c) {
case '*':
- if (!(c = *p)) return 1;
+ c = *p;
+ if (!c) return 1;
for (;;) {
if (!len) return 0;
if (*s == c) break;
- ++s; --len;
+ ++s;
+ --len;
}
continue;
case '+':
- if ((c = *p++) != *s) return 0;
+ c = *p++;
+ if (c != *s) return 0;
for (;;) {
if (!len) return 1;
if (*s != c) break;
- ++s; --len;
+ ++s;
+ --len;
}
continue;
/*
default:
if (!len) return 0;
if (*s != c) return 0;
- ++s; --len;
+ ++s;
+ --len;
continue;
}
}