summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h21
-rw-r--r--include/usage.h35
2 files changed, 33 insertions, 23 deletions
diff --git a/include/libbb.h b/include/libbb.h
index ef5086d..1d91a0a 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -85,7 +85,7 @@
/* CONFIG_LFS is on */
# if ULONG_MAX > 0xffffffff
/* "long" is long enough on this system */
-# define XSTRTOOFF xstrtoul
+# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX)
/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */
# define BB_STRTOOFF bb_strtoul
# define STRTOOFF strtoul
@@ -93,22 +93,23 @@
# define OFF_FMT "l"
# else
/* "long" is too short, need "long long" */
-# define XSTRTOOFF xstrtoull
+# define XATOOFF(a) xatoull_range(a, 0, LLONG_MAX)
# define BB_STRTOOFF bb_strtoull
# define STRTOOFF strtoull
# define OFF_FMT "ll"
# endif
#else
-# if 0 /* #if UINT_MAX == 0xffffffff */
-/* Doesn't work. off_t is a long. gcc will throw warnings on printf("%d", off_t)
- * even if long==int on this arch. Crap... */
-# define XSTRTOOFF xstrtou
-# define BB_STRTOOFF bb_strtoi
+/* CONFIG_LFS is off */
+# if UINT_MAX == 0xffffffff
+/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway.
+ * gcc will throw warnings on printf("%d", off_t). Crap... */
+# define XATOOFF(a) xatoi_u(a)
+# define BB_STRTOOFF bb_strtou
# define STRTOOFF strtol
-# define OFF_FMT ""
+# define OFF_FMT "l"
# else
-# define XSTRTOOFF xstrtoul
-# define BB_STRTOOFF bb_strtol
+# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX)
+# define BB_STRTOOFF bb_strtoul
# define STRTOOFF strtol
# define OFF_FMT "l"
# endif
diff --git a/include/usage.h b/include/usage.h
index b9310ac..0fba9b8 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -866,24 +866,33 @@ USE_FEATURE_DATE_ISOFMT( \
"\nEXPRESSION may consist of:\n" \
" -follow Dereference symbolic links\n" \
" -name PATTERN File name (leading directories removed) matches PATTERN\n" \
- " -print Print (default and assumed)\n" \
+ " -print Print (default and assumed)" \
USE_FEATURE_FIND_PRINT0( \
- " -print0 Delimit output with null characters rather than\n newlines" \
-) USE_FEATURE_FIND_TYPE( \
+ "\n -print0 Delimit output with null characters rather than" \
+ "\n newlines" \
+ ) USE_FEATURE_FIND_TYPE( \
"\n -type X Filetype matches X (where X is one of: f,d,l,b,c,...)" \
-) USE_FEATURE_FIND_PERM( \
- "\n -perm PERMS Permissions match any of (+NNN); all of (-NNN);\n or exactly (NNN)" \
-) USE_FEATURE_FIND_MTIME( \
- "\n -mtime DAYS Modified time is greater than (+N); less than (-N);\n or exactly (N) days" \
-) USE_FEATURE_FIND_MMIN( \
- "\n -mmin MINS Modified time is greater than (+N); less than (-N);\n or exactly (N) minutes" \
-) USE_FEATURE_FIND_NEWER( \
+ ) USE_FEATURE_FIND_PERM( \
+ "\n -perm PERMS Permissions match any of (+NNN); all of (-NNN);" \
+ "\n or exactly (NNN)" \
+ ) USE_FEATURE_FIND_MTIME( \
+ "\n -mtime DAYS Modified time is greater than (+N); less than (-N);" \
+ "\n or exactly (N) days" \
+ ) USE_FEATURE_FIND_MMIN( \
+ "\n -mmin MINS Modified time is greater than (+N); less than (-N);" \
+ "\n or exactly (N) minutes" \
+ ) USE_FEATURE_FIND_NEWER( \
"\n -newer FILE Modified time is more recent than FILE's" \
-) USE_FEATURE_FIND_INUM( \
+ ) USE_FEATURE_FIND_INUM( \
"\n -inum N File has inode number N" \
-) USE_FEATURE_FIND_EXEC( \
+ ) USE_FEATURE_FIND_EXEC( \
"\n -exec CMD Execute CMD with all instances of {} replaced by the" \
- "\n files matching EXPRESSION")
+ "\n files matching EXPRESSION" \
+ ) USE_DESKTOP( \
+ "\n -size N File size is N" \
+ "\n -prune Stop traversing current subtree" \
+ "\n (expr) Group" \
+ )
#define find_example_usage \
"$ find / -name passwd\n" \