Removes a couple of bytes.
Loïc
Index: libbb/xgetcwd.c
===================================================================
--- libbb/xgetcwd.c (révision 20109)
+++ libbb/xgetcwd.c (copie de travail)
@@ -23,16 +23,14 @@
char *ret;
unsigned path_max;
- path_max = (unsigned) PATH_MAX;
- path_max += 2; /* The getcwd docs say to do this. */
+ /* The getcwd docs say to increase PATH_MAX by 2 this. */
+ path_max = ((unsigned) PATH_MAX) + 2 - PATH_INCR;
- if (cwd == NULL)
- cwd = xmalloc(path_max);
-
- while ((ret = getcwd(cwd, path_max)) == NULL && errno == ERANGE) {
+ do {
path_max += PATH_INCR;
cwd = xrealloc(cwd, path_max);
}
+ while ((ret = getcwd(cwd, path_max)) == NULL && errno == ERANGE);
if (ret == NULL) {
free(cwd);
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox