diff options
| author | Joakim Verona | 2014-12-23 17:03:28 +0100 |
|---|---|---|
| committer | Joakim Verona | 2014-12-23 17:03:28 +0100 |
| commit | 5f46725992bf26f887483c14c63c03f5b5794f34 (patch) | |
| tree | 2896a2b98a65851eaddba81d0138fe5647005b08 /lib-src | |
| parent | 1d8b8a2d8f75d1e3ec9eb109e98720bd9a197bec (diff) | |
| parent | e3040f2aee768655198dd6f979a1ff3a72d17d16 (diff) | |
| download | emacs-5f46725992bf26f887483c14c63c03f5b5794f34.tar.gz emacs-5f46725992bf26f887483c14c63c03f5b5794f34.zip | |
Merge branch 'master' into xwidget
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/.gitignore | 7 | ||||
| -rw-r--r-- | lib-src/ChangeLog | 53 | ||||
| -rw-r--r-- | lib-src/Makefile.in | 52 | ||||
| -rw-r--r-- | lib-src/etags.c | 81 | ||||
| -rwxr-xr-x | lib-src/grep-changelog | 265 | ||||
| -rw-r--r-- | lib-src/movemail.c | 22 |
6 files changed, 110 insertions, 370 deletions
diff --git a/lib-src/.gitignore b/lib-src/.gitignore deleted file mode 100644 index c931a15d7b6..00000000000 --- a/lib-src/.gitignore +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | DOC | ||
| 2 | ctags.c | ||
| 3 | stamp_BLD | ||
| 4 | echolisp.tmp | ||
| 5 | |||
| 6 | oo/ | ||
| 7 | oo-spd/ | ||
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 199d46f4984..9b6c0daf210 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,48 @@ | |||
| 1 | 2014-12-14 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * grep-changelog: Remove file. | ||
| 4 | * Makefile.in (INSTALLABLE_SCRIPTS): Remove. | ||
| 5 | (all, install, uninstall): Remove INSTALLABLE_SCRIPTS. | ||
| 6 | |||
| 7 | 2014-11-23 Glenn Morris <rgm@gnu.org> | ||
| 8 | |||
| 9 | * Makefile.in (emacsclient.res): Fix yesterday's thinko. | ||
| 10 | |||
| 11 | 2014-11-22 Glenn Morris <rgm@gnu.org> | ||
| 12 | |||
| 13 | * Makefile.in (emacsclient.res): Update deps for nt/emacsclient.rc | ||
| 14 | now being in the build directory, not the source directory. | ||
| 15 | |||
| 16 | * Makefile.in (emacsclient.res): Add dependency on icons/emacs.ico. | ||
| 17 | |||
| 18 | 2014-10-20 Glenn Morris <rgm@gnu.org> | ||
| 19 | |||
| 20 | * Merge in all changes up to 24.4 release. | ||
| 21 | |||
| 22 | 2014-09-23 Paul Eggert <eggert@cs.ucla.edu> | ||
| 23 | |||
| 24 | movemail: don't dump core if the current time is outlandish | ||
| 25 | * movemail.c (popmail): Check for mbx_delimit_begin failure. | ||
| 26 | (mbx_delimit_begin): Fail if the current time is so outlandish | ||
| 27 | that localtime would fail or asctime would have undefined | ||
| 28 | behavior. Use strftime to avoid asctime undefined behavior. | ||
| 29 | |||
| 30 | 2014-09-01 Paul Eggert <eggert@cs.ucla.edu> | ||
| 31 | |||
| 32 | --enable-silent-rules now suppresses more chatter. | ||
| 33 | * Makefile.in (AM_DEFAULT_VERBOSITY, AM_V_CC, am__v_CC_) | ||
| 34 | (am__v_CC_0, am__v_CC_1, AM_V_CCLD, am__v_CCLD_, am__v_CCLD_0) | ||
| 35 | (am__v_CCLD_1): New macros, taken from Automake. | ||
| 36 | (regex.o, etags${EXEEXT}, ctags${EXEEXT}, ebrowse${EXEEXT}) | ||
| 37 | (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT}) | ||
| 38 | (pop.o, emacsclient${EXEEXT}, emacsclientw${EXEEXT}) | ||
| 39 | (emacsclientw${EXEEXT}, ntlib.o, hexl${EXEEXT}) | ||
| 40 | (update-game-score${EXEEXT}): Use them. | ||
| 41 | |||
| 42 | * etags.c (emacs_strchr, emacs_strrchr): Remove. | ||
| 43 | All uses replaced by strchr and strrchr, which are on all | ||
| 44 | target platforms now. | ||
| 45 | |||
| 1 | 2014-07-15 Paul Eggert <eggert@cs.ucla.edu> | 46 | 2014-07-15 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 47 | ||
| 3 | Use "b" flag more consistently; avoid "t" (Bug#18006). | 48 | Use "b" flag more consistently; avoid "t" (Bug#18006). |
| @@ -2972,7 +3017,7 @@ | |||
| 2972 | filter), show help instead of blindingly dumping every single | 3017 | filter), show help instead of blindingly dumping every single |
| 2973 | ChangeLog available. Doc fix. Update version. | 3018 | ChangeLog available. Doc fix. Update version. |
| 2974 | 3019 | ||
| 2975 | 2006-11-02 Tim Van Holder <tim.vanholder@gmail.com> (tiny change) | 3020 | 2006-11-02 Tim Van Holder <tim.vanholder@gmail.com> |
| 2976 | 3021 | ||
| 2977 | * emacsclient.c [WINDOWSNT]: Define HAVE_INET_SOCKETS. | 3022 | * emacsclient.c [WINDOWSNT]: Define HAVE_INET_SOCKETS. |
| 2978 | [!WINDOWSNT]: Include <netinet/in.h> if available. | 3023 | [!WINDOWSNT]: Include <netinet/in.h> if available. |
| @@ -2997,7 +3042,7 @@ | |||
| 2997 | (set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO | 3042 | (set_tcp_socket): Prefer O_NONBLOCK, then O_NDELAY, then FIONBIO |
| 2998 | to set the socket in non-blocking mode. | 3043 | to set the socket in non-blocking mode. |
| 2999 | 3044 | ||
| 3000 | 2006-10-31 Tim Van Holder <tim.vanholder@gmail.com> (tiny change) | 3045 | 2006-10-31 Tim Van Holder <tim.vanholder@gmail.com> |
| 3001 | 3046 | ||
| 3002 | * emacsclient.c [!WINDOWSNT]: Include <netinet/in.h> and <sys/ioctl.h>. | 3047 | * emacsclient.c [!WINDOWSNT]: Include <netinet/in.h> and <sys/ioctl.h>. |
| 3003 | (INVALID_SOCKET): Define. | 3048 | (INVALID_SOCKET): Define. |
| @@ -7711,7 +7756,7 @@ | |||
| 7711 | (consider_token): DEFUNs now treated like funcs in ctags mode. | 7756 | (consider_token): DEFUNs now treated like funcs in ctags mode. |
| 7712 | 7757 | ||
| 7713 | * etags.c (LEVEL_OK_FOR_FUNCDEF): Remove. | 7758 | * etags.c (LEVEL_OK_FOR_FUNCDEF): Remove. |
| 7714 | (C_entries): Optimized the test that used LEVEL_OK_FOR_FUNCDEF. | 7759 | (C_entries): Optimize the test that used LEVEL_OK_FOR_FUNCDEF. |
| 7715 | (C_entries): Remove a piece of useless code. | 7760 | (C_entries): Remove a piece of useless code. |
| 7716 | (C_entries): Making typedef tags is delayed until a semicolon | 7761 | (C_entries): Making typedef tags is delayed until a semicolon |
| 7717 | is met. This handles "typedef int X, Y, Z;" correctly. | 7762 | is met. This handles "typedef int X, Y, Z;" correctly. |
| @@ -8111,7 +8156,7 @@ | |||
| 8111 | * Makefile.in (prefix, bindir, libdir, srcdir): New variables, as | 8156 | * Makefile.in (prefix, bindir, libdir, srcdir): New variables, as |
| 8112 | described in the top-level Makefile. | 8157 | described in the top-level Makefile. |
| 8113 | (UTILITIES): Add make-path to the list of utility programs. | 8158 | (UTILITIES): Add make-path to the list of utility programs. |
| 8114 | (../arch-lib): Replaced by the ${archlibdir} target, which places | 8159 | (../arch-lib): Replace by the ${archlibdir} target, which places |
| 8115 | the executables in their permanent home. | 8160 | the executables in their permanent home. |
| 8116 | (install, install.sysv, install.xenix): Consolidated into one | 8161 | (install, install.sysv, install.xenix): Consolidated into one |
| 8117 | target which should work under all circumstances, modulo a few | 8162 | target which should work under all circumstances, modulo a few |
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 7eb13f667ec..cae0898a2c4 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in | |||
| @@ -45,6 +45,19 @@ UPDATE_MANIFEST = @UPDATE_MANIFEST@ | |||
| 45 | # Program name transformation. | 45 | # Program name transformation. |
| 46 | TRANSFORM = @program_transform_name@ | 46 | TRANSFORM = @program_transform_name@ |
| 47 | 47 | ||
| 48 | # 'make' verbosity. | ||
| 49 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
| 50 | |||
| 51 | AM_V_CC = $(am__v_CC_@AM_V@) | ||
| 52 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) | ||
| 53 | am__v_CC_0 = @echo " CC " $@; | ||
| 54 | am__v_CC_1 = | ||
| 55 | |||
| 56 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) | ||
| 57 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) | ||
| 58 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
| 59 | am__v_CCLD_1 = | ||
| 60 | |||
| 48 | # ==================== Where To Install Things ==================== | 61 | # ==================== Where To Install Things ==================== |
| 49 | 62 | ||
| 50 | # Location to install Emacs.app under GNUstep / Mac OS X. | 63 | # Location to install Emacs.app under GNUstep / Mac OS X. |
| @@ -124,8 +137,6 @@ CLIENTW = @CLIENTW@ | |||
| 124 | INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \ | 137 | INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \ |
| 125 | ebrowse${EXEEXT} | 138 | ebrowse${EXEEXT} |
| 126 | 139 | ||
| 127 | INSTALLABLE_SCRIPTS = grep-changelog | ||
| 128 | |||
| 129 | # Things that Emacs runs internally, or during the build process, | 140 | # Things that Emacs runs internally, or during the build process, |
| 130 | # which should not be installed in bindir. | 141 | # which should not be installed in bindir. |
| 131 | UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \ | 142 | UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \ |
| @@ -202,7 +213,7 @@ CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS} | |||
| 202 | # Configuration files for .o files to depend on. | 213 | # Configuration files for .o files to depend on. |
| 203 | config_h = ../src/config.h $(srcdir)/../src/conf_post.h | 214 | config_h = ../src/config.h $(srcdir)/../src/conf_post.h |
| 204 | 215 | ||
| 205 | all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} | 216 | all: ${EXE_FILES} ${SCRIPTS} |
| 206 | 217 | ||
| 207 | .PHONY: all need-blessmail maybe-blessmail | 218 | .PHONY: all need-blessmail maybe-blessmail |
| 208 | 219 | ||
| @@ -268,17 +279,11 @@ install: $(DESTDIR)${archlibdir} | |||
| 268 | for file in ${INSTALLABLES} ; do \ | 279 | for file in ${INSTALLABLES} ; do \ |
| 269 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ | 280 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
| 270 | done | 281 | done |
| 271 | for file in ${INSTALLABLE_SCRIPTS} ; do \ | ||
| 272 | $(INSTALL_SCRIPT) ${srcdir}/$${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \ | ||
| 273 | done | ||
| 274 | 282 | ||
| 275 | uninstall: | 283 | uninstall: |
| 276 | for file in ${INSTALLABLES}; do \ | 284 | for file in ${INSTALLABLES}; do \ |
| 277 | rm -f "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ | 285 | rm -f "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
| 278 | done | 286 | done |
| 279 | for file in ${INSTALLABLE_SCRIPTS}; do \ | ||
| 280 | rm -f "$(DESTDIR)${bindir}"/`echo $${file} | sed '$(TRANSFORM)'` ; \ | ||
| 281 | done | ||
| 282 | if [ -d "$(DESTDIR)${archlibdir}" ]; then \ | 287 | if [ -d "$(DESTDIR)${archlibdir}" ]; then \ |
| 283 | (cd "$(DESTDIR)${archlibdir}" && rm -f ${UTILITIES} ${SCRIPTS}) \ | 288 | (cd "$(DESTDIR)${archlibdir}" && rm -f ${UTILITIES} ${SCRIPTS}) \ |
| 284 | fi | 289 | fi |
| @@ -311,7 +316,7 @@ TAGS: etags${EXEEXT} | |||
| 311 | $(MAKE) -C ../lib libgnu.a | 316 | $(MAKE) -C ../lib libgnu.a |
| 312 | 317 | ||
| 313 | regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) | 318 | regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) |
| 314 | ${CC} -c ${CPP_CFLAGS} $< | 319 | $(AM_V_CC)$(CC) -c $(CPP_CFLAGS) $< |
| 315 | 320 | ||
| 316 | 321 | ||
| 317 | etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) | 322 | etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) |
| @@ -319,41 +324,41 @@ etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@ | |||
| 319 | etags_libs = regex.o $(LOADLIBES) $(NTLIB) | 324 | etags_libs = regex.o $(LOADLIBES) $(NTLIB) |
| 320 | 325 | ||
| 321 | etags${EXEEXT}: ${etags_deps} | 326 | etags${EXEEXT}: ${etags_deps} |
| 322 | $(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) | 327 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) |
| 323 | 328 | ||
| 324 | ## ctags.c is distinct from etags.c so that parallel makes do not write two | 329 | ## ctags.c is distinct from etags.c so that parallel makes do not write two |
| 325 | ## etags.o files on top of each other. | 330 | ## etags.o files on top of each other. |
| 326 | ## FIXME? | 331 | ## FIXME? |
| 327 | ## Can't we use a wrapper that calls 'etags --ctags'? | 332 | ## Can't we use a wrapper that calls 'etags --ctags'? |
| 328 | ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps} | 333 | ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps} |
| 329 | $(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) | 334 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) |
| 330 | 335 | ||
| 331 | ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ | 336 | ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ |
| 332 | $(config_h) | 337 | $(config_h) |
| 333 | $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ | 338 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ |
| 334 | $< $(LOADLIBES) $(NTLIB) -o $@ | 339 | $< $(LOADLIBES) $(NTLIB) -o $@ |
| 335 | 340 | ||
| 336 | profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h) | 341 | profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h) |
| 337 | $(CC) ${ALL_CFLAGS} $< \ | 342 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \ |
| 338 | $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@ | 343 | $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@ |
| 339 | 344 | ||
| 340 | make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h) | 345 | make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h) |
| 341 | $(CC) ${ALL_CFLAGS} $< $(LOADLIBES) $(NTLIB) -o $@ | 346 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LOADLIBES) $(NTLIB) -o $@ |
| 342 | 347 | ||
| 343 | movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h) | 348 | movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h) |
| 344 | $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \ | 349 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \ |
| 345 | $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o $@ | 350 | $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o $@ |
| 346 | 351 | ||
| 347 | pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h) | 352 | pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h) |
| 348 | $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} $< | 353 | $(AM_V_CC)$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} $< |
| 349 | 354 | ||
| 350 | emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) | 355 | emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) |
| 351 | $(CC) ${ALL_CFLAGS} $< \ | 356 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \ |
| 352 | -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \ | 357 | -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \ |
| 353 | $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ | 358 | $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ |
| 354 | 359 | ||
| 355 | emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) | 360 | emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) |
| 356 | $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \ | 361 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \ |
| 357 | -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \ | 362 | -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \ |
| 358 | $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ | 363 | $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ |
| 359 | 364 | ||
| @@ -365,16 +370,17 @@ NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \ | |||
| 365 | # The dependency on $(NTDEPS) is a trick intended to cause recompile of | 370 | # The dependency on $(NTDEPS) is a trick intended to cause recompile of |
| 366 | # programs on MinGW whenever some private header in nt/inc is modified. | 371 | # programs on MinGW whenever some private header in nt/inc is modified. |
| 367 | ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS) | 372 | ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS) |
| 368 | $(CC) -c ${CPP_CFLAGS} $< | 373 | $(AM_V_CC)$(CC) -c ${CPP_CFLAGS} $< |
| 369 | 374 | ||
| 370 | hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h) | 375 | hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h) |
| 371 | $(CC) ${ALL_CFLAGS} $< $(LOADLIBES) -o $@ | 376 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LOADLIBES) -o $@ |
| 372 | 377 | ||
| 373 | update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) | 378 | update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) |
| 374 | $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ | 379 | $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} \ |
| 380 | -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ | ||
| 375 | $< $(LOADLIBES) $(NTLIB) -o $@ | 381 | $< $(LOADLIBES) $(NTLIB) -o $@ |
| 376 | 382 | ||
| 377 | emacsclient.res: $(NTINC)/../emacsclient.rc | 383 | emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico |
| 378 | $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< | 384 | $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< |
| 379 | 385 | ||
| 380 | ## Makefile ends here. | 386 | ## Makefile ends here. |
diff --git a/lib-src/etags.c b/lib-src/etags.c index ae5491a8204..6639ac4f235 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -314,7 +314,7 @@ static long readline_internal (linebuffer *, FILE *); | |||
| 314 | static bool nocase_tail (const char *); | 314 | static bool nocase_tail (const char *); |
| 315 | static void get_tag (char *, char **); | 315 | static void get_tag (char *, char **); |
| 316 | 316 | ||
| 317 | static void analyse_regex (char *); | 317 | static void analyze_regex (char *); |
| 318 | static void free_regexps (void); | 318 | static void free_regexps (void); |
| 319 | static void regex_tag_multiline (void); | 319 | static void regex_tag_multiline (void); |
| 320 | static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); | 320 | static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); |
| @@ -339,8 +339,6 @@ static char *skip_non_spaces (char *); | |||
| 339 | static char *skip_name (char *); | 339 | static char *skip_name (char *); |
| 340 | static char *savenstr (const char *, int); | 340 | static char *savenstr (const char *, int); |
| 341 | static char *savestr (const char *); | 341 | static char *savestr (const char *); |
| 342 | static char *etags_strchr (const char *, int); | ||
| 343 | static char *etags_strrchr (const char *, int); | ||
| 344 | static char *etags_getcwd (void); | 342 | static char *etags_getcwd (void); |
| 345 | static char *relative_filename (char *, char *); | 343 | static char *relative_filename (char *, char *); |
| 346 | static char *absolute_filename (char *, char *); | 344 | static char *absolute_filename (char *, char *); |
| @@ -1209,7 +1207,7 @@ main (int argc, char **argv) | |||
| 1209 | lang = argbuffer[i].lang; | 1207 | lang = argbuffer[i].lang; |
| 1210 | break; | 1208 | break; |
| 1211 | case at_regexp: | 1209 | case at_regexp: |
| 1212 | analyse_regex (argbuffer[i].what); | 1210 | analyze_regex (argbuffer[i].what); |
| 1213 | break; | 1211 | break; |
| 1214 | case at_filename: | 1212 | case at_filename: |
| 1215 | this_file = argbuffer[i].what; | 1213 | this_file = argbuffer[i].what; |
| @@ -1334,8 +1332,8 @@ get_compressor_from_suffix (char *file, char **extptr) | |||
| 1334 | 1332 | ||
| 1335 | /* File has been processed by canonicalize_filename, | 1333 | /* File has been processed by canonicalize_filename, |
| 1336 | so we don't need to consider backslashes on DOS_NT. */ | 1334 | so we don't need to consider backslashes on DOS_NT. */ |
| 1337 | slash = etags_strrchr (file, '/'); | 1335 | slash = strrchr (file, '/'); |
| 1338 | suffix = etags_strrchr (file, '.'); | 1336 | suffix = strrchr (file, '.'); |
| 1339 | if (suffix == NULL || suffix < slash) | 1337 | if (suffix == NULL || suffix < slash) |
| 1340 | return NULL; | 1338 | return NULL; |
| 1341 | if (extptr != NULL) | 1339 | if (extptr != NULL) |
| @@ -1422,7 +1420,7 @@ get_language_from_filename (char *file, int case_sensitive) | |||
| 1422 | return lang; | 1420 | return lang; |
| 1423 | 1421 | ||
| 1424 | /* If not found, try suffix after last dot. */ | 1422 | /* If not found, try suffix after last dot. */ |
| 1425 | suffix = etags_strrchr (file, '.'); | 1423 | suffix = strrchr (file, '.'); |
| 1426 | if (suffix == NULL) | 1424 | if (suffix == NULL) |
| 1427 | return NULL; | 1425 | return NULL; |
| 1428 | suffix += 1; | 1426 | suffix += 1; |
| @@ -1699,7 +1697,7 @@ find_entries (FILE *inf) | |||
| 1699 | /* Set lp to point at the first char after the last slash in the | 1697 | /* Set lp to point at the first char after the last slash in the |
| 1700 | line or, if no slashes, at the first nonblank. Then set cp to | 1698 | line or, if no slashes, at the first nonblank. Then set cp to |
| 1701 | the first successive blank and terminate the string. */ | 1699 | the first successive blank and terminate the string. */ |
| 1702 | lp = etags_strrchr (lb.buffer+2, '/'); | 1700 | lp = strrchr (lb.buffer+2, '/'); |
| 1703 | if (lp != NULL) | 1701 | if (lp != NULL) |
| 1704 | lp += 1; | 1702 | lp += 1; |
| 1705 | else | 1703 | else |
| @@ -1884,9 +1882,9 @@ pfnote (char *name, bool is_func, char *linestart, int linelen, int lno, | |||
| 1884 | /* If ctags mode, change name "main" to M<thisfilename>. */ | 1882 | /* If ctags mode, change name "main" to M<thisfilename>. */ |
| 1885 | if (CTAGS && !cxref_style && streq (name, "main")) | 1883 | if (CTAGS && !cxref_style && streq (name, "main")) |
| 1886 | { | 1884 | { |
| 1887 | register char *fp = etags_strrchr (curfdp->taggedfname, '/'); | 1885 | char *fp = strrchr (curfdp->taggedfname, '/'); |
| 1888 | np->name = concat ("M", fp == NULL ? curfdp->taggedfname : fp + 1, ""); | 1886 | np->name = concat ("M", fp == NULL ? curfdp->taggedfname : fp + 1, ""); |
| 1889 | fp = etags_strrchr (np->name, '.'); | 1887 | fp = strrchr (np->name, '.'); |
| 1890 | if (fp != NULL && fp[1] != '\0' && fp[2] == '\0') | 1888 | if (fp != NULL && fp[1] != '\0' && fp[2] == '\0') |
| 1891 | fp[0] = '\0'; | 1889 | fp[0] = '\0'; |
| 1892 | } | 1890 | } |
| @@ -4116,7 +4114,7 @@ Ada_funcs (FILE *inf) | |||
| 4116 | /* Skip a string i.e. "abcd". */ | 4114 | /* Skip a string i.e. "abcd". */ |
| 4117 | if (inquote || (*dbp == '"')) | 4115 | if (inquote || (*dbp == '"')) |
| 4118 | { | 4116 | { |
| 4119 | dbp = etags_strchr (dbp + !inquote, '"'); | 4117 | dbp = strchr (dbp + !inquote, '"'); |
| 4120 | if (dbp != NULL) | 4118 | if (dbp != NULL) |
| 4121 | { | 4119 | { |
| 4122 | inquote = false; | 4120 | inquote = false; |
| @@ -4274,7 +4272,7 @@ Perl_functions (FILE *inf) | |||
| 4274 | cp++; | 4272 | cp++; |
| 4275 | if (cp == sp) | 4273 | if (cp == sp) |
| 4276 | continue; /* nothing found */ | 4274 | continue; /* nothing found */ |
| 4277 | if ((pos = etags_strchr (sp, ':')) != NULL | 4275 | if ((pos = strchr (sp, ':')) != NULL |
| 4278 | && pos < cp && pos[1] == ':') | 4276 | && pos < cp && pos[1] == ':') |
| 4279 | /* The name is already qualified. */ | 4277 | /* The name is already qualified. */ |
| 4280 | make_tag (sp, cp - sp, true, | 4278 | make_tag (sp, cp - sp, true, |
| @@ -5029,7 +5027,7 @@ TEX_decode_env (const char *evarname, const char *defenv) | |||
| 5029 | 5027 | ||
| 5030 | /* Allocate a token table */ | 5028 | /* Allocate a token table */ |
| 5031 | for (len = 1, p = env; p;) | 5029 | for (len = 1, p = env; p;) |
| 5032 | if ((p = etags_strchr (p, ':')) && *++p != '\0') | 5030 | if ((p = strchr (p, ':')) && *++p != '\0') |
| 5033 | len++; | 5031 | len++; |
| 5034 | TEX_toktab = xnew (len, linebuffer); | 5032 | TEX_toktab = xnew (len, linebuffer); |
| 5035 | 5033 | ||
| @@ -5037,7 +5035,7 @@ TEX_decode_env (const char *evarname, const char *defenv) | |||
| 5037 | /* zero-length strings (leading ':', "::" and trailing ':') */ | 5035 | /* zero-length strings (leading ':', "::" and trailing ':') */ |
| 5038 | for (i = 0; *env != '\0';) | 5036 | for (i = 0; *env != '\0';) |
| 5039 | { | 5037 | { |
| 5040 | p = etags_strchr (env, ':'); | 5038 | p = strchr (env, ':'); |
| 5041 | if (!p) /* End of environment string. */ | 5039 | if (!p) /* End of environment string. */ |
| 5042 | p = env + strlen (env); | 5040 | p = env + strlen (env); |
| 5043 | if (p - env > 0) | 5041 | if (p - env > 0) |
| @@ -5575,7 +5573,7 @@ scan_separators (char *name) | |||
| 5575 | /* Look at the argument of --regex or --no-regex and do the right | 5573 | /* Look at the argument of --regex or --no-regex and do the right |
| 5576 | thing. Same for each line of a regexp file. */ | 5574 | thing. Same for each line of a regexp file. */ |
| 5577 | static void | 5575 | static void |
| 5578 | analyse_regex (char *regex_arg) | 5576 | analyze_regex (char *regex_arg) |
| 5579 | { | 5577 | { |
| 5580 | if (regex_arg == NULL) | 5578 | if (regex_arg == NULL) |
| 5581 | { | 5579 | { |
| @@ -5606,7 +5604,7 @@ analyse_regex (char *regex_arg) | |||
| 5606 | pfatal (regexfile); | 5604 | pfatal (regexfile); |
| 5607 | linebuffer_init (®exbuf); | 5605 | linebuffer_init (®exbuf); |
| 5608 | while (readline_internal (®exbuf, regexfp) > 0) | 5606 | while (readline_internal (®exbuf, regexfp) > 0) |
| 5609 | analyse_regex (regexbuf.buffer); | 5607 | analyze_regex (regexbuf.buffer); |
| 5610 | free (regexbuf.buffer); | 5608 | free (regexbuf.buffer); |
| 5611 | fclose (regexfp); | 5609 | fclose (regexfp); |
| 5612 | } | 5610 | } |
| @@ -5767,9 +5765,9 @@ substitute (char *in, char *out, struct re_registers *regs) | |||
| 5767 | /* Pass 1: figure out how much to allocate by finding all \N strings. */ | 5765 | /* Pass 1: figure out how much to allocate by finding all \N strings. */ |
| 5768 | if (out[size - 1] == '\\') | 5766 | if (out[size - 1] == '\\') |
| 5769 | fatal ("pattern error in \"%s\"", out); | 5767 | fatal ("pattern error in \"%s\"", out); |
| 5770 | for (t = etags_strchr (out, '\\'); | 5768 | for (t = strchr (out, '\\'); |
| 5771 | t != NULL; | 5769 | t != NULL; |
| 5772 | t = etags_strchr (t + 2, '\\')) | 5770 | t = strchr (t + 2, '\\')) |
| 5773 | if (ISDIGIT (t[1])) | 5771 | if (ISDIGIT (t[1])) |
| 5774 | { | 5772 | { |
| 5775 | dig = t[1] - '0'; | 5773 | dig = t[1] - '0'; |
| @@ -6051,7 +6049,7 @@ readline (linebuffer *lbp, FILE *stream) | |||
| 6051 | { | 6049 | { |
| 6052 | char *endp = lbp->buffer + start; | 6050 | char *endp = lbp->buffer + start; |
| 6053 | 6051 | ||
| 6054 | while ((endp = etags_strchr (endp, '"')) != NULL | 6052 | while ((endp = strchr (endp, '"')) != NULL |
| 6055 | && endp[-1] == '\\') | 6053 | && endp[-1] == '\\') |
| 6056 | endp++; | 6054 | endp++; |
| 6057 | if (endp != NULL) | 6055 | if (endp != NULL) |
| @@ -6236,43 +6234,6 @@ savenstr (const char *cp, int len) | |||
| 6236 | return memcpy (dp, cp, len); | 6234 | return memcpy (dp, cp, len); |
| 6237 | } | 6235 | } |
| 6238 | 6236 | ||
| 6239 | /* | ||
| 6240 | * Return the ptr in sp at which the character c last | ||
| 6241 | * appears; NULL if not found | ||
| 6242 | * | ||
| 6243 | * Identical to POSIX strrchr, included for portability. | ||
| 6244 | */ | ||
| 6245 | static char * | ||
| 6246 | etags_strrchr (register const char *sp, register int c) | ||
| 6247 | { | ||
| 6248 | register const char *r; | ||
| 6249 | |||
| 6250 | r = NULL; | ||
| 6251 | do | ||
| 6252 | { | ||
| 6253 | if (*sp == c) | ||
| 6254 | r = sp; | ||
| 6255 | } while (*sp++); | ||
| 6256 | return (char *)r; | ||
| 6257 | } | ||
| 6258 | |||
| 6259 | /* | ||
| 6260 | * Return the ptr in sp at which the character c first | ||
| 6261 | * appears; NULL if not found | ||
| 6262 | * | ||
| 6263 | * Identical to POSIX strchr, included for portability. | ||
| 6264 | */ | ||
| 6265 | static char * | ||
| 6266 | etags_strchr (register const char *sp, register int c) | ||
| 6267 | { | ||
| 6268 | do | ||
| 6269 | { | ||
| 6270 | if (*sp == c) | ||
| 6271 | return (char *)sp; | ||
| 6272 | } while (*sp++); | ||
| 6273 | return NULL; | ||
| 6274 | } | ||
| 6275 | |||
| 6276 | /* Skip spaces (end of string is not space), return new pointer. */ | 6237 | /* Skip spaces (end of string is not space), return new pointer. */ |
| 6277 | static char * | 6238 | static char * |
| 6278 | skip_spaces (char *cp) | 6239 | skip_spaces (char *cp) |
| @@ -6398,7 +6359,7 @@ relative_filename (char *file, char *dir) | |||
| 6398 | 6359 | ||
| 6399 | /* Build a sequence of "../" strings for the resulting relative file name. */ | 6360 | /* Build a sequence of "../" strings for the resulting relative file name. */ |
| 6400 | i = 0; | 6361 | i = 0; |
| 6401 | while ((dp = etags_strchr (dp + 1, '/')) != NULL) | 6362 | while ((dp = strchr (dp + 1, '/')) != NULL) |
| 6402 | i += 1; | 6363 | i += 1; |
| 6403 | res = xnew (3*i + strlen (fp + 1) + 1, char); | 6364 | res = xnew (3*i + strlen (fp + 1) + 1, char); |
| 6404 | res[0] = '\0'; | 6365 | res[0] = '\0'; |
| @@ -6431,7 +6392,7 @@ absolute_filename (char *file, char *dir) | |||
| 6431 | res = concat (dir, file, ""); | 6392 | res = concat (dir, file, ""); |
| 6432 | 6393 | ||
| 6433 | /* Delete the "/dirname/.." and "/." substrings. */ | 6394 | /* Delete the "/dirname/.." and "/." substrings. */ |
| 6434 | slashp = etags_strchr (res, '/'); | 6395 | slashp = strchr (res, '/'); |
| 6435 | while (slashp != NULL && slashp[0] != '\0') | 6396 | while (slashp != NULL && slashp[0] != '\0') |
| 6436 | { | 6397 | { |
| 6437 | if (slashp[1] == '.') | 6398 | if (slashp[1] == '.') |
| @@ -6463,7 +6424,7 @@ absolute_filename (char *file, char *dir) | |||
| 6463 | } | 6424 | } |
| 6464 | } | 6425 | } |
| 6465 | 6426 | ||
| 6466 | slashp = etags_strchr (slashp + 1, '/'); | 6427 | slashp = strchr (slashp + 1, '/'); |
| 6467 | } | 6428 | } |
| 6468 | 6429 | ||
| 6469 | if (res[0] == '\0') /* just a safety net: should never happen */ | 6430 | if (res[0] == '\0') /* just a safety net: should never happen */ |
| @@ -6484,7 +6445,7 @@ absolute_dirname (char *file, char *dir) | |||
| 6484 | char *slashp, *res; | 6445 | char *slashp, *res; |
| 6485 | char save; | 6446 | char save; |
| 6486 | 6447 | ||
| 6487 | slashp = etags_strrchr (file, '/'); | 6448 | slashp = strrchr (file, '/'); |
| 6488 | if (slashp == NULL) | 6449 | if (slashp == NULL) |
| 6489 | return savestr (dir); | 6450 | return savestr (dir); |
| 6490 | save = slashp[1]; | 6451 | save = slashp[1]; |
diff --git a/lib-src/grep-changelog b/lib-src/grep-changelog deleted file mode 100755 index ab8c5e38618..00000000000 --- a/lib-src/grep-changelog +++ /dev/null | |||
| @@ -1,265 +0,0 @@ | |||
| 1 | #! /usr/bin/perl | ||
| 2 | |||
| 3 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. | ||
| 4 | # | ||
| 5 | # This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | # GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | # it under the terms of the GNU General Public License as published by | ||
| 9 | # the Free Software Foundation, either version 3 of the License, or | ||
| 10 | # (at your option) any later version. | ||
| 11 | |||
| 12 | # GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | # GNU General Public License for more details. | ||
| 16 | |||
| 17 | # You should have received a copy of the GNU General Public License | ||
| 18 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | |||
| 21 | # Extract entries from ChangeLogs matching specified criteria. | ||
| 22 | # Optionally format the resulting output to a form suitable for RCS | ||
| 23 | # logs, like they are used in Emacs, for example. In this format, | ||
| 24 | # author lines, leading spaces, and file names are removed. | ||
| 25 | |||
| 26 | require 5; | ||
| 27 | use strict; | ||
| 28 | |||
| 29 | # Parse command line options. | ||
| 30 | |||
| 31 | use vars qw($author $regexp $exclude $from_date $to_date | ||
| 32 | $rcs_log $with_date $version $help $reverse | ||
| 33 | @entries); | ||
| 34 | |||
| 35 | use Getopt::Long; | ||
| 36 | |||
| 37 | my $result; | ||
| 38 | |||
| 39 | if (@ARGV == 0) { | ||
| 40 | |||
| 41 | # No arguments cannot possibly mean "show everything"!! | ||
| 42 | $result = 0; | ||
| 43 | |||
| 44 | } else { | ||
| 45 | |||
| 46 | $result = GetOptions ("author=s" => \$author, | ||
| 47 | "text=s" => \$regexp, | ||
| 48 | "exclude=s" => \$exclude, | ||
| 49 | "from-date=s" => \$from_date, | ||
| 50 | "to-date=s" => \$to_date, | ||
| 51 | "rcs-log" => \$rcs_log, | ||
| 52 | "with-date" => \$with_date, | ||
| 53 | "reverse!" => \$reverse, | ||
| 54 | "version" => \$version, | ||
| 55 | "help" => \$help); | ||
| 56 | |||
| 57 | # If date options are specified, check that they have the format | ||
| 58 | # YYYY-MM-DD. | ||
| 59 | |||
| 60 | $result = 0 if $from_date && $from_date !~ /^\d\d\d\d-\d\d-\d\d$/; | ||
| 61 | $result = 0 if $to_date && $to_date !~ /^\d\d\d\d-\d\d-\d\d$/; | ||
| 62 | } | ||
| 63 | |||
| 64 | # Print usage information and exit when necessary. | ||
| 65 | |||
| 66 | if ($result == 0 || $help) { | ||
| 67 | print <<USAGE; | ||
| 68 | |||
| 69 | Usage: $0 [options] [CHANGELOG...] | ||
| 70 | |||
| 71 | Print entries in ChangeLogs matching various criteria. | ||
| 72 | Valid options are: | ||
| 73 | |||
| 74 | --author=AUTHOR Match entries whose author line matches | ||
| 75 | regular expression AUTHOR | ||
| 76 | --text=TEXT Match entries whose text matches regular | ||
| 77 | expression TEXT | ||
| 78 | --exclude=TEXT Exclude entries matching TEXT | ||
| 79 | --from-date=YYYY-MM-DD Match entries not older than given date | ||
| 80 | --to-date=YYYY-MM-DD Match entries not younger than given date | ||
| 81 | --rcs-log Format output suitable for RCS log entries | ||
| 82 | --with-date Print short date line in RCS log | ||
| 83 | --reverse Show entries in reverse (chronological) order | ||
| 84 | --version Print version info | ||
| 85 | --help Print this help | ||
| 86 | |||
| 87 | If no CHANGELOG is specified scan the files "ChangeLog" and | ||
| 88 | "ChangeLog.N+" in the current directory. Old-style dates in ChangeLogs | ||
| 89 | are not recognized. | ||
| 90 | USAGE | ||
| 91 | exit !$help; | ||
| 92 | } | ||
| 93 | |||
| 94 | # Print version info and exit if `--version' was specified. | ||
| 95 | |||
| 96 | if ($version) { | ||
| 97 | print "0.3\n"; | ||
| 98 | exit 0; | ||
| 99 | } | ||
| 100 | |||
| 101 | |||
| 102 | # Value is non-zero if HEADER matches according to command line | ||
| 103 | # options specified, i.e. it matches $author, and its date is in | ||
| 104 | # the range $from_date <= date <= $to_date. | ||
| 105 | |||
| 106 | sub header_match_p { | ||
| 107 | my $header = shift; | ||
| 108 | |||
| 109 | return 0 unless $header; | ||
| 110 | |||
| 111 | # No match if AUTHOR-regexp specified and doesn't match. | ||
| 112 | return 0 if $author && $header !~ /$author/; | ||
| 113 | |||
| 114 | # Check that the date of the entry matches if date options | ||
| 115 | # `--from-date' and/or `--to-date' were specified . Old-style | ||
| 116 | # dates in ChangeLogs are not recognized, and never match. | ||
| 117 | if ($from_date || $to_date) { | ||
| 118 | if ($header =~ /^(\d\d\d\d-\d\d-\d\d)/) { | ||
| 119 | my $date = $1; | ||
| 120 | return 0 if $from_date && $date lt $from_date; | ||
| 121 | return 0 if $to_date && $date gt $to_date; | ||
| 122 | } else { | ||
| 123 | # Don't bother recognizing old-style dates. | ||
| 124 | return 0; | ||
| 125 | } | ||
| 126 | } | ||
| 127 | |||
| 128 | return 1; | ||
| 129 | } | ||
| 130 | |||
| 131 | |||
| 132 | # Value is non-zero if ENTRY matches the criteria specified on the | ||
| 133 | # command line, i.e. it matches $regexp, and it doesn't match | ||
| 134 | # $exclude. | ||
| 135 | |||
| 136 | sub entry_match_p { | ||
| 137 | my $entry = shift; | ||
| 138 | |||
| 139 | return 0 unless $entry; | ||
| 140 | |||
| 141 | if ($regexp) { | ||
| 142 | return 1 if ($entry =~ /$regexp/ | ||
| 143 | && (!$exclude || $entry !~ $exclude)); | ||
| 144 | } else { | ||
| 145 | return 1 if !$exclude || $entry !~ $exclude; | ||
| 146 | } | ||
| 147 | |||
| 148 | return 0; | ||
| 149 | } | ||
| 150 | |||
| 151 | |||
| 152 | # Print HEADER and/or ENTRY in a format suitable for what was | ||
| 153 | # specified on the command line. If $rcs_log is specified, author | ||
| 154 | # lines are not printed, and leading spaces and file names are removed | ||
| 155 | # from ChangeLog entries. | ||
| 156 | |||
| 157 | sub print_log { | ||
| 158 | my ($header, $entry) = @_; | ||
| 159 | my $output = ''; | ||
| 160 | |||
| 161 | if ($rcs_log) { | ||
| 162 | # Remove leading whitespace from entry. | ||
| 163 | $entry =~ s/^\s+//mg; | ||
| 164 | # Remove file name parts. | ||
| 165 | $entry =~ s/^\*.*\(/(/mg; | ||
| 166 | # Remove file name parts, 2. | ||
| 167 | $entry =~ s/^\*.*://mg; | ||
| 168 | if ($with_date) { | ||
| 169 | $header =~ /(\d\d\d\d-\d\d-\d\d)/; | ||
| 170 | $output = "!changelog-date $1\n"; | ||
| 171 | } | ||
| 172 | $output .= $entry; | ||
| 173 | } else { | ||
| 174 | $output .= $header . $entry; | ||
| 175 | } | ||
| 176 | |||
| 177 | if ($reverse) { | ||
| 178 | push @entries, $output; | ||
| 179 | } else { | ||
| 180 | print $output; | ||
| 181 | } | ||
| 182 | } | ||
| 183 | |||
| 184 | # Scan LOG for matching entries, and print them to standard output. | ||
| 185 | |||
| 186 | sub parse_changelog { | ||
| 187 | my $log = shift; | ||
| 188 | my $entry = undef; | ||
| 189 | my $header = undef; | ||
| 190 | |||
| 191 | @entries = () if $reverse; | ||
| 192 | |||
| 193 | # Open the ChangeLog. | ||
| 194 | open (IN, "< $log") || die "Cannot open $log: $!"; | ||
| 195 | |||
| 196 | while (defined(my $line = <IN>)) { | ||
| 197 | if ($line =~ /^\S/) { | ||
| 198 | # Line is an author-line. Print previous entry if | ||
| 199 | # it matches. | ||
| 200 | print_log ($header, $entry) | ||
| 201 | if header_match_p ($header) && entry_match_p ($entry); | ||
| 202 | |||
| 203 | $entry = ""; | ||
| 204 | $header = $line; | ||
| 205 | |||
| 206 | # Add empty lines below the header. | ||
| 207 | while (defined($line = <IN>) && $line =~ /^\s*$/) { | ||
| 208 | $header = "$header$line"; | ||
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 212 | last unless defined $line; | ||
| 213 | |||
| 214 | if ($line =~ /^\s*\*/) { | ||
| 215 | # LINE is the first line of a ChangeLog entry. Print | ||
| 216 | # previous entry if it matches. | ||
| 217 | print_log ($header, $entry) | ||
| 218 | if header_match_p ($header) && entry_match_p ($entry); | ||
| 219 | $entry = $line; | ||
| 220 | } else { | ||
| 221 | # Add LINE to the current entry. | ||
| 222 | $entry = "$entry$line"; | ||
| 223 | } | ||
| 224 | } | ||
| 225 | |||
| 226 | # Print last entry if it matches. | ||
| 227 | print_log ($header, $entry) | ||
| 228 | if header_match_p ($header) && entry_match_p ($entry); | ||
| 229 | |||
| 230 | close IN; | ||
| 231 | |||
| 232 | if ($reverse) { | ||
| 233 | for (my $entry = @entries; $entry; $entry--) { | ||
| 234 | print $entries[$entry-1]; | ||
| 235 | } | ||
| 236 | } | ||
| 237 | } | ||
| 238 | |||
| 239 | |||
| 240 | # Main program. Process ChangeLogs. | ||
| 241 | |||
| 242 | # If files were specified on the command line, parse those files in the | ||
| 243 | # order supplied by the user; otherwise parse default files ChangeLog and | ||
| 244 | # ChangeLog.NNN according to $reverse. | ||
| 245 | unless (@ARGV > 0) { | ||
| 246 | @ARGV = ("ChangeLog"); | ||
| 247 | |||
| 248 | push @ARGV, | ||
| 249 | map {"ChangeLog.$_"} | ||
| 250 | sort {$b <=> $a} | ||
| 251 | map {/\.(\d+)$/; $1} | ||
| 252 | do { | ||
| 253 | opendir D, '.'; | ||
| 254 | grep /^ChangeLog\.\d+$/, readdir D; | ||
| 255 | }; | ||
| 256 | |||
| 257 | @ARGV = reverse @ARGV if $reverse; | ||
| 258 | } | ||
| 259 | |||
| 260 | while (defined (my $log = shift @ARGV)) { | ||
| 261 | parse_changelog ($log) if -f $log; | ||
| 262 | } | ||
| 263 | |||
| 264 | |||
| 265 | # grep-changelog ends here. | ||
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index c600fc0ea53..b0196b309d8 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -714,8 +714,8 @@ popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse | |||
| 714 | 714 | ||
| 715 | for (i = start; i * increment <= end * increment; i += increment) | 715 | for (i = start; i * increment <= end * increment; i += increment) |
| 716 | { | 716 | { |
| 717 | mbx_delimit_begin (mbf); | 717 | if (mbx_delimit_begin (mbf) != OK |
| 718 | if (pop_retr (server, i, mbf) != OK) | 718 | || pop_retr (server, i, mbf) != OK) |
| 719 | { | 719 | { |
| 720 | error ("%s", Errmsg, 0); | 720 | error ("%s", Errmsg, 0); |
| 721 | close (mbfi); | 721 | close (mbfi); |
| @@ -832,15 +832,15 @@ mbx_write (char *line, int len, FILE *mbf) | |||
| 832 | static int | 832 | static int |
| 833 | mbx_delimit_begin (FILE *mbf) | 833 | mbx_delimit_begin (FILE *mbf) |
| 834 | { | 834 | { |
| 835 | time_t now; | 835 | time_t now = time (NULL); |
| 836 | struct tm *ltime; | 836 | struct tm *ltime = localtime (&now); |
| 837 | char fromline[40] = "From movemail "; | 837 | if (!ltime) |
| 838 | 838 | return NOTOK; | |
| 839 | now = time (NULL); | 839 | |
| 840 | ltime = localtime (&now); | 840 | char fromline[100]; |
| 841 | 841 | if (! strftime (fromline, sizeof fromline, | |
| 842 | strcat (fromline, asctime (ltime)); | 842 | "From movemail %a %b %e %T %Y\n", ltime)) |
| 843 | 843 | return NOTOK; | |
| 844 | if (fputs (fromline, mbf) == EOF) | 844 | if (fputs (fromline, mbf) == EOF) |
| 845 | return (NOTOK); | 845 | return (NOTOK); |
| 846 | return (OK); | 846 | return (OK); |