More minor touchups.
-Erik
This commit is contained in:
@ -86,6 +86,10 @@
|
|||||||
- added "skip" and "seek" to dd.
|
- added "skip" and "seek" to dd.
|
||||||
* swapoff -a was not working. Now it is.
|
* swapoff -a was not working. Now it is.
|
||||||
* init did not cleanly unmount filesystems on reboot. Now it does.
|
* init did not cleanly unmount filesystems on reboot. Now it does.
|
||||||
|
* "sed -ne s/foo/bar/" worked but "sed -n -e s/foo/bar/" didn't.
|
||||||
|
Now both work.
|
||||||
|
* Some architectures (PowerPc) assume chars are unsigned, so they could
|
||||||
|
not distinguish between EOF and '\0xFF' in sed. Sed now uses ints.
|
||||||
|
|
||||||
|
|
||||||
-Erik Andersen
|
-Erik Andersen
|
||||||
|
@ -82,7 +82,7 @@ static inline int at_last(FILE * fp)
|
|||||||
if (feof(fp))
|
if (feof(fp))
|
||||||
return 1;
|
return 1;
|
||||||
else {
|
else {
|
||||||
char ch;
|
int ch;
|
||||||
|
|
||||||
if ((ch = fgetc(fp)) == EOF)
|
if ((ch = fgetc(fp)) == EOF)
|
||||||
res++;
|
res++;
|
||||||
@ -183,6 +183,7 @@ extern int sed_main(int argc, char **argv)
|
|||||||
usage(sed_usage);
|
usage(sed_usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (argc > 1) {
|
||||||
if (**argv == '-') {
|
if (**argv == '-') {
|
||||||
argc--;
|
argc--;
|
||||||
cp = *argv++;
|
cp = *argv++;
|
||||||
@ -306,6 +307,7 @@ extern int sed_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
switch (sed_f) {
|
switch (sed_f) {
|
||||||
|
8
find.c
8
find.c
@ -39,13 +39,7 @@ static const char find_usage[] = "find [PATH...] [EXPRESSION]\n\n"
|
|||||||
"\nEXPRESSION may consist of:\n"
|
"\nEXPRESSION may consist of:\n"
|
||||||
"\t-follow\n\t\tDereference symbolic links.\n"
|
"\t-follow\n\t\tDereference symbolic links.\n"
|
||||||
"\t-name PATTERN\n\t\tFile name (with leading directories removed) matches PATTERN.\n"
|
"\t-name PATTERN\n\t\tFile name (with leading directories removed) matches PATTERN.\n"
|
||||||
"\t-print\n\t\tprint the full file name followed by a newline to stdout.\n\n"
|
"\t-print\n\t\tprint the full file name followed by a newline to stdout.\n";
|
||||||
#if defined BB_REGEXP
|
|
||||||
"This version of find matches full regular expresions.\n";
|
|
||||||
#else
|
|
||||||
"This version of find matches strings (not regular expresions).\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int fileAction(const char *fileName, struct stat *statbuf)
|
static int fileAction(const char *fileName, struct stat *statbuf)
|
||||||
|
@ -39,13 +39,7 @@ static const char find_usage[] = "find [PATH...] [EXPRESSION]\n\n"
|
|||||||
"\nEXPRESSION may consist of:\n"
|
"\nEXPRESSION may consist of:\n"
|
||||||
"\t-follow\n\t\tDereference symbolic links.\n"
|
"\t-follow\n\t\tDereference symbolic links.\n"
|
||||||
"\t-name PATTERN\n\t\tFile name (with leading directories removed) matches PATTERN.\n"
|
"\t-name PATTERN\n\t\tFile name (with leading directories removed) matches PATTERN.\n"
|
||||||
"\t-print\n\t\tprint the full file name followed by a newline to stdout.\n\n"
|
"\t-print\n\t\tprint the full file name followed by a newline to stdout.\n";
|
||||||
#if defined BB_REGEXP
|
|
||||||
"This version of find matches full regular expresions.\n";
|
|
||||||
#else
|
|
||||||
"This version of find matches strings (not regular expresions).\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int fileAction(const char *fileName, struct stat *statbuf)
|
static int fileAction(const char *fileName, struct stat *statbuf)
|
||||||
|
4
sed.c
4
sed.c
@ -82,7 +82,7 @@ static inline int at_last(FILE * fp)
|
|||||||
if (feof(fp))
|
if (feof(fp))
|
||||||
return 1;
|
return 1;
|
||||||
else {
|
else {
|
||||||
char ch;
|
int ch;
|
||||||
|
|
||||||
if ((ch = fgetc(fp)) == EOF)
|
if ((ch = fgetc(fp)) == EOF)
|
||||||
res++;
|
res++;
|
||||||
@ -183,6 +183,7 @@ extern int sed_main(int argc, char **argv)
|
|||||||
usage(sed_usage);
|
usage(sed_usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (argc > 1) {
|
||||||
if (**argv == '-') {
|
if (**argv == '-') {
|
||||||
argc--;
|
argc--;
|
||||||
cp = *argv++;
|
cp = *argv++;
|
||||||
@ -306,6 +307,7 @@ extern int sed_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
switch (sed_f) {
|
switch (sed_f) {
|
||||||
|
Reference in New Issue
Block a user