[TRIVIAL] avoid "expr length" (improved version)

From: Rusty Russell
Date: Mon Mar 22 2004 - 18:56:26 EST


From: Martin Schaffner <maschaffner@xxxxxx>

---
I improved my patch to avoid the "expr length" GNU-ism. It should be
much clearer now. It uses "wc -c" to count the letters.

Thanks,
Martin


--- trivial-2.6.5-rc2-bk2/Makefile.orig 2004-03-23 10:11:35.000000000 +1100
+++ trivial-2.6.5-rc2-bk2/Makefile 2004-03-23 10:11:35.000000000 +1100
@@ -652,7 +652,7 @@
uts_len := 64

define filechk_version.h
- if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \
+ if ((`echo -n "$(KERNELRELEASE)" | wc -c ` > $(uts_len))); then \
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi; \
--
What is this? http://www.kernel.org/pub/linux/kernel/people/rusty/trivial/
Don't blame me: the Monkey is driving
File: Martin Schaffner <maschaffner@xxxxxx>: [PATCH] avoid "expr length" (improved version)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/