]> code.citadel.org Git - citadel.git/blobdiff - citadel/utils/ctdl3264_prep.sh
Fixed imap_append() from clearing all flags on messages and avoid purge_user() from...
[citadel.git] / citadel / utils / ctdl3264_prep.sh
index 8a1cffc9d102048c5dd04ad27647e73d11344964..cb3a5bbd268c5b382e7c034a7dd8dd2fb7d345cd 100755 (executable)
@@ -6,11 +6,17 @@
 # Source our data structures from the real live working code
 SERVER_H=server/server.h
 
+tail_opt=
+tail +1 ${SERVER_H} > /dev/null 2>&1
+if [ $? != 0 ] ; then
+       tail_opt=-n
+fi
+
 # Generate the "32-bit" versions of these structures.
 # Note that this is specifically for converting "32-bit to 64-bit" -- NOT "any-to-any"
 convert_struct() {
        start_line=$(cat ${SERVER_H} | egrep -n "^struct $1 {" | cut -d: -f1)
-       tail +${start_line} ${SERVER_H} | sed '/};/q' \
+       tail ${tail_opt} +${start_line} ${SERVER_H} | sed '/};/q' \
        | sed s/"^struct $1 {"/"struct ${1}_32 {"/g \
        | sed s/"long "/"int32_t "/g \
        | sed s/"time_t "/"int32_t "/g \