summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTizenOpenSource <tizenopensrc@samsung.com>2023-12-22 10:26:51 +0900
committerTizenOpenSource <tizenopensrc@samsung.com>2023-12-22 10:26:51 +0900
commit902a2cbbb3e9ce18b4ce821042ee670b4acfed8c (patch)
tree20a3fecd0f5b9e93c0c587eb221b7773238fa4f5
parentd8e6a4836d9f24efe8ccd9044eb357f9957c0130 (diff)
downloadmtools-upstream.tar.gz
mtools-upstream.tar.bz2
mtools-upstream.zip
Imported Upstream version 4.0.43upstream/4.0.43upstream
-rw-r--r--NEWS9
-rwxr-xr-xconfig.guess6
-rw-r--r--config.h.in3
-rwxr-xr-xconfig.sub8
-rwxr-xr-xconfigure2
-rw-r--r--configure.in2
-rw-r--r--debian/changelog12
-rw-r--r--file_name.c24
-rw-r--r--file_name.h3
-rw-r--r--floppyd.12
-rw-r--r--floppyd_installtest.12
-rw-r--r--mainloop.c171
-rw-r--r--mainloop.h64
-rw-r--r--mattrib.12
-rw-r--r--mattrib.c2
-rw-r--r--mbadblocks.12
-rw-r--r--mbadblocks.c4
-rw-r--r--mcat.12
-rw-r--r--mcat.c1
-rw-r--r--mcd.12
-rw-r--r--mcopy.12
-rw-r--r--mcopy.c112
-rw-r--r--mdel.12
-rw-r--r--mdeltree.12
-rw-r--r--mdir.12
-rw-r--r--mdu.12
-rw-r--r--mformat.17
-rw-r--r--mformat.c26
-rw-r--r--minfo.12
-rw-r--r--mk_direntry.c1
-rw-r--r--mkmanifest.12
-rw-r--r--mlabel.12
-rw-r--r--mlabel.c6
-rw-r--r--mmd.12
-rw-r--r--mmount.12
-rw-r--r--mmove.12
-rw-r--r--mmove.c5
-rw-r--r--mpartition.12
-rw-r--r--mpartition.c1
-rw-r--r--mrd.12
-rw-r--r--mren.12
-rw-r--r--mshortname.12
-rw-r--r--mshowfat.12
-rw-r--r--mtools.14
-rw-r--r--mtools.54
-rw-r--r--mtools.info141
-rw-r--r--mtools.spec11
-rw-r--r--mtools.texi5
-rw-r--r--mtools.tmpl.14
-rw-r--r--mtools.tmpl.54
-rw-r--r--mtoolstest.12
-rw-r--r--mtype.12
-rw-r--r--mzip.12
-rw-r--r--nameclash.h3
-rw-r--r--patchlevel.c6
-rw-r--r--stream.h2
-rw-r--r--streamcache.c1
-rw-r--r--texinfo.tex1406
-rw-r--r--unixdir.c36
-rw-r--r--version.texi6
-rw-r--r--vfat.h8
61 files changed, 1152 insertions, 1008 deletions
diff --git a/NEWS b/NEWS
index 0916f3a..35e44df 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
+v4_0_43
+ - Fix root directory test in mattrib
+ - -b BiosDisk flag for mformat to allow setting physdrive to
+ a user-specified value
+ - Clearer error message in mformat when trying to mformat a
+ disk whose total size is not known
+ - Make recursive copy more consistent
+ - Trailing slash now always implies target should be a directory
+ - Code cleanup
v4_0_42
- Added postcmd attribute in drive description to allow to
execute "device release" code automatically at end of
diff --git a/config.guess b/config.guess
index f7995d3..45297a2 100755
--- a/config.guess
+++ b/config.guess
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2022 Free Software Foundation, Inc.
+# Copyright 1992-2023 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2022-09-17'
+timestamp='2023-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2022 Free Software Foundation, Inc.
+Copyright 1992-2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
diff --git a/config.h.in b/config.h.in
index 6245cd1..d2217c5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -32,9 +32,6 @@
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
-/* Define to 1 if you have the `fchdir' function. */
-#undef HAVE_FCHDIR
-
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
diff --git a/config.sub b/config.sub
index baf1512..de4259e 100755
--- a/config.sub
+++ b/config.sub
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2022 Free Software Foundation, Inc.
+# Copyright 1992-2023 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2022-09-17'
+timestamp='2023-01-21'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2022 Free Software Foundation, Inc.
+Copyright 1992-2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -1075,7 +1075,7 @@ case $cpu-$vendor in
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
cpu=i586
;;
- pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
cpu=i686
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
diff --git a/configure b/configure
index 5868736..8e05510 100755
--- a/configure
+++ b/configure
@@ -5501,7 +5501,7 @@ for ac_func in strerror random srandom strchr strrchr lockf flock \
strcasecmp strncasecmp strnlen atexit on_exit getpass memmove \
strdup strndup strcspn strspn strtoul strtol strtoll strtoui \
memcpy strpbrk memset setenv seteuid setresuid \
-tcsetattr tcflush basename fchdir \
+tcsetattr tcflush basename \
readdir snprintf setlocale strstr toupper_l strncasecmp_l \
wcsdup wcscasecmp wcsnlen putwc \
alarm sigaction usleep lstat unsetenv mkdir
diff --git a/configure.in b/configure.in
index c83be70..1de916e 100644
--- a/configure.in
+++ b/configure.in
@@ -222,7 +222,7 @@ AC_CHECK_FUNCS(strerror random srandom strchr strrchr lockf flock \
strcasecmp strncasecmp strnlen atexit on_exit getpass memmove \
strdup strndup strcspn strspn strtoul strtol strtoll strtoui \
memcpy strpbrk memset setenv seteuid setresuid \
-tcsetattr tcflush basename fchdir \
+tcsetattr tcflush basename \
readdir snprintf setlocale strstr toupper_l strncasecmp_l \
wcsdup wcscasecmp wcsnlen putwc \
alarm sigaction usleep lstat unsetenv mkdir)
diff --git a/debian/changelog b/debian/changelog
index 092bb7d..4d767d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+mtools (4.0.43) stable; urgency=low
+ * Fix root directory test in mattrib
+ * -b BiosDisk flag for mformat to allow setting physdrive to a
+ user-specified value
+ * Clearer error message in mformat when trying to mformat a disk whose
+ total size is not known
+ * Make recursive copy more consistent
+ * Trailing slash now always implies target should be a directory
+ * Code cleanup
+
+
+ -- Alain Knaff <alain@knaff.lu> Tue, 21 Mar 2023 23:20:45 +0100
mtools (4.0.42) stable; urgency=low
* Added postcmd attribute in drive description to allow to
diff --git a/file_name.c b/file_name.c
index 4f5b389..2e1e1ab 100644
--- a/file_name.c
+++ b/file_name.c
@@ -190,3 +190,27 @@ wchar_t *unix_name(doscp_t *dosCp,
return ret;
}
+int isSpecial(const char *name)
+{
+ if(name[0] == '\0')
+ return 1;
+ if(!strcmp(name,"."))
+ return 1;
+ if(!strcmp(name,".."))
+ return 1;
+ return 0;
+}
+
+#ifdef HAVE_WCHAR_H
+int isSpecialW(const wchar_t *name)
+{
+ if(name[0] == '\0')
+ return 1;
+ if(!wcscmp(name,L"."))
+ return 1;
+ if(!wcscmp(name,L".."))
+ return 1;
+ return 0;
+}
+#endif
+
diff --git a/file_name.h b/file_name.h
index 5e70ccc..aa1de18 100644
--- a/file_name.h
+++ b/file_name.h
@@ -51,6 +51,9 @@ wchar_t *unix_name(doscp_t *fromDos,
const char *base, const char *ext, uint8_t Case,
wchar_t *answer);
+/* Is this a "special" directory entry, such as . or .. ? */
+int isSpecial(const char *name);
+
#ifdef HAVE_WCHAR_H
int isSpecialW(const wchar_t *name);
#else
diff --git a/floppyd.1 b/floppyd.1
index c65e89e..700136d 100644
--- a/floppyd.1
+++ b/floppyd.1
@@ -1,5 +1,5 @@
'\" t
-.TH floppyd 1 "22Oct22" mtools-4.0.42
+.TH floppyd 1 "21Mar23" mtools-4.0.43
.SH Name
floppyd - floppy daemon for remote access to floppy drive
'\" t
diff --git a/floppyd_installtest.1 b/floppyd_installtest.1
index c2309d4..6cdf73e 100644
--- a/floppyd_installtest.1
+++ b/floppyd_installtest.1
@@ -1,5 +1,5 @@
'\" t
-.TH floppyd_installtest 1 "22Oct22" mtools-4.0.42
+.TH floppyd_installtest 1 "21Mar23" mtools-4.0.43
.SH Name
floppyd_installtest - tests whether floppyd is installed and running
'\" t
diff --git a/mainloop.c b/mainloop.c
index ff16244..7b9f8a0 100644
--- a/mainloop.c
+++ b/mainloop.c
@@ -83,10 +83,6 @@ static const char *fix_mcwd(char *ans)
return ans;
}
-int unix_dir_loop(Stream_t *Stream, MainParam_t *mp);
-int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp, char *arg,
- int follow_dir_link);
-
static int _unix_loop(Stream_t *Dir, MainParam_t *mp,
const char *filename UNUSEDP)
{
@@ -157,31 +153,6 @@ int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp,
return ret;
}
-
-int isSpecial(const char *name)
-{
- if(name[0] == '\0')
- return 1;
- if(!strcmp(name,"."))
- return 1;
- if(!strcmp(name,".."))
- return 1;
- return 0;
-}
-
-#ifdef HAVE_WCHAR_H
-int isSpecialW(const wchar_t *name)
-{
- if(name[0] == '\0')
- return 1;
- if(!wcscmp(name,L"."))
- return 1;
- if(!wcscmp(name,L".."))
- return 1;
- return 0;
-}
-#endif
-
static int checkForDot(int lookupflags, const wchar_t *name)
{
return (lookupflags & NO_DOTS) && isSpecialW(name);
@@ -202,7 +173,8 @@ static int isUniqueTarget(const char *name)
}
static int handle_leaf(direntry_t *direntry, MainParam_t *mp,
- lookupState_t *lookupState)
+ lookupState_t *lookupState,
+ Stream_t **DeferredFileP)
{
Stream_t *MyFile=0;
int ret;
@@ -234,13 +206,24 @@ static int handle_leaf(direntry_t *direntry, MainParam_t *mp,
MyFile = mp->File = OpenFileByDirentry(direntry);
ret = mp->dirCallback(direntry, mp);
} else {
- if(mp->lookupflags & DO_OPEN)
+ if(mp->lookupflags & DO_OPEN) {
+ if(DeferredFileP && *DeferredFileP) {
+ /* Already a deferred file => close it and error */
+ FREE(DeferredFileP);
+ fprintf(stderr,
+ "Attempt to copy multiple files to non-directory\n");
+ return STOP_NOW | ERROR_ONE;
+ }
+
MyFile = mp->File = OpenFileByDirentry(direntry);
+ if(DeferredFileP) {
+ *DeferredFileP = MyFile;
+ return 0;
+ }
+ }
ret = mp->callback(direntry, mp);
}
FREE(&MyFile);
- if(isUniqueTarget(mp->targetName))
- ret |= STOP_NOW;
return ret;
}
@@ -290,7 +273,8 @@ static int _dos_loop(Stream_t *Dir, MainParam_t *mp, const char *filename)
static int recurs_dos_loop(MainParam_t *mp, const char *filename0,
const char *filename1,
- lookupState_t *lookupState)
+ lookupState_t *lookupState,
+ Stream_t **DeferredFileP)
{
/* Dir is de-allocated by the same entity which allocated it */
const char *ptr;
@@ -330,7 +314,8 @@ static int recurs_dos_loop(MainParam_t *mp, const char *filename0,
(!strcmp(filename0, "..") && filename1)) {
/* up one level */
mp->File = getDirentry(mp->File)->Dir;
- return recurs_dos_loop(mp, filename0+2, filename1, lookupState);
+ return recurs_dos_loop(mp, filename0+2, filename1, lookupState,
+ DeferredFileP);
}
doing_mcwd = !!filename1;
@@ -348,19 +333,19 @@ static int recurs_dos_loop(MainParam_t *mp, const char *filename0,
if(mp->lookupflags & OPEN_PARENT) {
mp->targetName = filename0;
ret = handle_leaf(getDirentry(mp->File), mp,
- lookupState);
+ lookupState, NULL);
mp->targetName = 0;
return ret;
}
if(!strcmp(filename0, ".") || !filename0[0]) {
return handle_leaf(getDirentry(mp->File),
- mp, lookupState);
+ mp, lookupState, NULL);
}
if(!strcmp(filename0, "..")) {
return handle_leaf(getParent(getDirentry(mp->File)), mp,
- lookupState);
+ lookupState, NULL);
}
lookupflags = mp->lookupflags;
@@ -400,12 +385,12 @@ static int recurs_dos_loop(MainParam_t *mp, const char *filename0,
if(ptr) {
Stream_t *SubDir;
SubDir = mp->File = OpenFileByDirentry(&entry);
- ret |= recurs_dos_loop(mp, ptr, filename1, lookupState);
+ ret |= recurs_dos_loop(mp, ptr, filename1, lookupState,
+ DeferredFileP);
FREE(&SubDir);
} else {
- ret |= handle_leaf(&entry, mp, lookupState);
- if(isUniqueTarget(mp->targetName))
- return ret | STOP_NOW;
+ ret |= handle_leaf(&entry, mp, lookupState,
+ DeferredFileP);
}
if(doing_mcwd)
break;
@@ -426,6 +411,8 @@ static int common_dos_loop(MainParam_t *mp, const char *pathname,
Stream_t *RootDir;
const char *cwd;
char drive;
+ Stream_t *DeferredFile=NULL;
+ Stream_t **DeferredFileP=NULL;
int ret;
mp->loop = _dos_loop;
@@ -451,12 +438,22 @@ static int common_dos_loop(MainParam_t *mp, const char *pathname,
if(!mp->File)
return ERROR_ONE;
- ret = recurs_dos_loop(mp, cwd, pathname, lookupState);
+ if(mp->originalArg && strpbrk(mp->originalArg, "*[?") != 0 &&
+ (mp->lookupflags & DEFERABLE) &&
+ isUniqueTarget(mp->targetName))
+ DeferredFileP = &DeferredFile;
+
+ ret = recurs_dos_loop(mp, cwd, pathname, lookupState, DeferredFileP);
if(ret & NO_CWD) {
/* no CWD */
*mp->mcwd = '\0';
unlink_mcwd();
- ret = recurs_dos_loop(mp, "", pathname, lookupState);
+ ret = recurs_dos_loop(mp, "", pathname, lookupState, DeferredFileP);
+ }
+ if(DeferredFile) {
+ mp->File = DeferredFile;
+ ret = mp->callback(NULL, mp);
+ FREE(&DeferredFile);
}
FREE(&RootDir);
return ret;
@@ -468,7 +465,7 @@ static int dos_loop(MainParam_t *mp, const char *arg)
}
-static int dos_target_lookup(MainParam_t *mp, const char *arg)
+int dos_target_lookup(MainParam_t *mp, const char *arg)
{
lookupState_t lookupState;
int ret;
@@ -509,56 +506,6 @@ static int dos_target_lookup(MainParam_t *mp, const char *arg)
}
}
-/*
- * Is target a Unix directory
- * -1 error occured
- * 0 regular file
- * 1 directory
- */
-static int unix_is_dir(const char *name)
-{
- struct stat buf;
- if(stat(name, &buf) < 0)
- return -1;
- else
- return 1 && S_ISDIR(buf.st_mode);
-}
-
-static int unix_target_lookup(MainParam_t *mp, const char *arg)
-{
- char *ptr;
- mp->unixTarget = strdup(arg);
- /* try complete filename */
- if(access(mp->unixTarget, F_OK) == 0) {
- switch(unix_is_dir(mp->unixTarget)) {
- case -1:
- return ERROR_ONE;
- case 0:
- mp->targetName="";
- break;
- }
- return GOT_ONE;
- }
- ptr = strrchr(mp->unixTarget, '/');
- if(!ptr) {
- mp->targetName = mp->unixTarget;
- mp->unixTarget = strdup(".");
- return GOT_ONE;
- } else {
- *ptr = '\0';
- mp->targetName = ptr+1;
- return GOT_ONE;
- }
-}
-
-int target_lookup(MainParam_t *mp, const char *arg)
-{
- if((mp->lookupflags & NO_UNIX) || (arg[0] && arg[1] == ':' ))
- return dos_target_lookup(mp, arg);
- else
- return unix_target_lookup(mp, arg);
-}
-
int main_loop(MainParam_t *mp, char **argv, int argc)
{
int i;
@@ -622,15 +569,16 @@ void init_mp(MainParam_t *mp)
{
fix_mcwd(mp->mcwd);
mp->openflags = O_RDONLY;
+ mp->lookupflags = 0;
mp->targetName = 0;
mp->targetDir = 0;
- mp->unixTarget = 0;
mp->dirCallback = dispatchToFile;
mp->unixcallback = NULL;
mp->shortname.data = mp->longname.data = 0;
mp->shortname.len = mp->longname.len = 0;
mp->File = 0;
mp->fast_quit = 0;
+ mp->originalArg = 0;
}
const char *mpGetBasename(MainParam_t *mp)
@@ -660,34 +608,3 @@ const char *mpPickTargetName(MainParam_t *mp)
else
return mpGetBasename(mp);
}
-
-char *mpBuildUnixFilename(MainParam_t *mp)
-{
- const char *target;
- char *ret;
- char *tmp;
-
- target = mpPickTargetName(mp);
- ret = malloc(strlen(mp->unixTarget) + 2 + strlen(target));
- if(!ret)
- return 0;
- strcpy(ret, mp->unixTarget);
- if(*target) {
- /* fix for 'mcopy -n x:file existingfile' -- H. Lermen 980816 */
- if(!mp->targetName && !mp->targetDir && !unix_is_dir(ret))
- return ret;
- strcat(ret, "/");
- if(!strcmp(target, ".")) {
- target="DOT";
- } else if(!strcmp(target, "..")) {
- target="DOTDOT";
- }
- while( (tmp=strchr(target, '/')) ) {
- strncat(ret, target, ptrdiff(tmp,target));
- strcat(ret, "\\");
- target=tmp+1;
- }
- strcat(ret, target);
- }
- return ret;
-}
diff --git a/mainloop.h b/mainloop.h
index 22076b5..dbeb3de 100644
--- a/mainloop.h
+++ b/mainloop.h
@@ -38,47 +38,60 @@ typedef struct MainParam_t {
void *arg; /* command-specific parameters
* to be passed to callback */
- int openflags; /* flags used to open disk */
- int lookupflags; /* flags used to lookup up using vfat_lookup */
+ int openflags; /* flags used to open disk, supplied by application */
+
+ int lookupflags; /* flags used to lookup up using vfat_lookup,
+ supplied by application */
+
int fast_quit; /* for commands manipulating multiple files, quit
- * as soon as even _one_ file has a problem */
+ * as soon as even _one_ file has a
+ * problem. Supplied by application, used by
+ * mattrib and mcopy */
bounded_string shortname; /* where to put the short name of the
- * matched file */
+ * matched file, used by mdir and mmove */
bounded_string longname; /* where to put the long name of the
- * matched file */
+ * matched file, used by mdir and mmove */
/* out parameters */
- Stream_t *File;
+ Stream_t *File; /* needed by mattrib, mcopy */
+
+ direntry_t *direntry; /* dir of this entry: needed by mmove */
- direntry_t *direntry; /* dir of this entry */
char *unixSourceName; /* filename of the last opened Unix source
- * file (Unix equiv of Dos direntry) */
+ * file (Unix equiv of Dos direntry). Only used
+ * when "copying" from Unix */
- Stream_t *targetDir; /* directory where to place files */
- char *unixTarget; /* directory on Unix where to put files */
+ Stream_t *targetDir; /* directory on Dos where to place files
+ or subdirectories. Needed by mcopy,
+ mmd, mmove */
const char *targetName; /* basename of target file, or NULL if same
- * basename as source should be conserved */
+ * basename as source should be conserved,
+ * needed by mcopy, mmd, mmove */
+
+ char *originalArg; /* original argument, complete with wildcards.
+ * Used by mainloop internally for display in printed
+ * messages */
- char *originalArg; /* original argument, complete with wildcards */
int basenameHasWildcard; /* true if there are wildcards in the
- * basename */
-
+ * basename. Output only parameter,
+ * needed by mdir, mcopy */
/* internal data */
- char mcwd[MAX_PATH+4];
-
- char *fileName; /* resolved Unix filename */
-
- char targetBuffer[4*MAX_VNAMELEN+1]; /* buffer for target name */
+ char mcwd[MAX_PATH+4]; /* needed by mcwd and mmove */
+
+ char targetBuffer[4*MAX_VNAMELEN+1]; /* buffer for target
+ name, only used by
+ mpGetBasename() and
+ callers as a temporary
+ output for formatted
+ name */
} MainParam_t;
void init_mp(MainParam_t *MainParam);
int main_loop(MainParam_t *MainParam, char **argv, int argc);
-int target_lookup(MainParam_t *mp, const char *arg);
-
-Stream_t *open_root_dir(char drivename, int flags, int *isRop);
+int dos_target_lookup(MainParam_t *mp, const char *arg);
const char *mpGetBasename(MainParam_t *mp); /* statically allocated
* string */
@@ -86,10 +99,9 @@ const char *mpGetBasename(MainParam_t *mp); /* statically allocated
void mpPrintFilename(FILE *file, MainParam_t *mp);
const char *mpPickTargetName(MainParam_t *mp); /* statically allocated string */
-char *mpBuildUnixFilename(MainParam_t *mp); /* dynamically allocated, must
- * be freed */
-
-int isSpecial(const char *name);
+int unix_dir_loop(Stream_t *Stream, MainParam_t *mp);
+int unix_loop(Stream_t *Stream UNUSEDP, MainParam_t *mp, char *arg,
+ int follow_dir_link);
#define MISSED_ONE 2 /* set if one cmd line argument didn't match any files */
#define GOT_ONE 4 /* set if a match was found, used for exit status */
diff --git a/mattrib.1 b/mattrib.1
index 4f7bf81..fa98109 100644
--- a/mattrib.1
+++ b/mattrib.1
@@ -1,5 +1,5 @@
'\" t
-.TH mattrib 1 "22Oct22" mtools-4.0.42
+.TH mattrib 1 "21Mar23" mtools-4.0.43
.SH Name
mattrib - change MSDOS file attribute flags
'\" t
diff --git a/mattrib.c b/mattrib.c
index 29ef1da..e5cac78 100644
--- a/mattrib.c
+++ b/mattrib.c
@@ -34,7 +34,7 @@ static int attrib_file(direntry_t *entry, MainParam_t *mp)
{
Arg_t *arg=(Arg_t *) mp->arg;
- if(isRootEntry(entry)) {
+ if(!isRootEntry(entry)) {
/* if not root directory, change it */
entry->dir.attr = (entry->dir.attr & arg->remove) | arg->add;
dir_write(entry);
diff --git a/mbadblocks.1 b/mbadblocks.1
index ef73957..c758ebc 100644
--- a/mbadblocks.1
+++ b/mbadblocks.1
@@ -1,5 +1,5 @@
'\" t
-.TH mbadblocks 1 "22Oct22" mtools-4.0.42
+.TH mbadblocks 1 "21Mar23" mtools-4.0.43
.SH Name
mbadblocks - tests a floppy disk, and marks the bad blocks in the FAT
'\" t
diff --git a/mbadblocks.c b/mbadblocks.c
index 0f68abb..9b54331 100644
--- a/mbadblocks.c
+++ b/mbadblocks.c
@@ -21,7 +21,6 @@
#include "sysincludes.h"
#include "mtools.h"
-#include "mainloop.h"
#include "fsP.h"
#define N_PATTERN 311
@@ -114,7 +113,6 @@ void mbadblocks(int argc, char **argv, int type UNUSEDP)
unsigned int i;
unsigned int startSector=2;
unsigned int endSector=0;
- struct MainParam_t mp;
Fs_t *Fs;
Stream_t *Dir;
int ret;
@@ -159,8 +157,6 @@ void mbadblocks(int argc, char **argv, int type UNUSEDP)
usage(1);
}
- init_mp(&mp);
-
Dir = open_root_dir(argv[optind][0], O_RDWR, NULL);
if (!Dir) {
fprintf(stderr,"%s: Cannot initialize drive\n", argv[0]);
diff --git a/mcat.1 b/mcat.1
index bae7611..6071cac 100644
--- a/mcat.1
+++ b/mcat.1
@@ -1,5 +1,5 @@
'\" t
-.TH mcat 1 "22Oct22" mtools-4.0.42
+.TH mcat 1 "21Mar23" mtools-4.0.43
.SH Name
mcat - dump raw disk image
'\" t
diff --git a/mcat.c b/mcat.c
index 45ebc1e..629b6dc 100644
--- a/mcat.c
+++ b/mcat.c
@@ -21,7 +21,6 @@
#include "sysincludes.h"
#include "mtools.h"
-#include "mainloop.h"
#include "open_image.h"
static void usage(void) NORETURN;
diff --git a/mcd.1 b/mcd.1
index 6804b36..4dc28b2 100644
--- a/mcd.1
+++ b/mcd.1
@@ -1,5 +1,5 @@
'\" t
-.TH mcd 1 "22Oct22" mtools-4.0.42
+.TH mcd 1 "21Mar23" mtools-4.0.43
.SH Name
mcd - change MSDOS directory
'\" t
diff --git a/mcopy.1 b/mcopy.1
index 8df022e..65b7d96 100644
--- a/mcopy.1
+++ b/mcopy.1
@@ -1,5 +1,5 @@
'\" t
-.TH mcopy 1 "22Oct22" mtools-4.0.42
+.TH mcopy 1 "21Mar23" mtools-4.0.43
.SH Name
mcopy - copy MSDOS files to/from Unix
'\" t
diff --git a/mcopy.c b/mcopy.c
index ff548e7..2219423 100644
--- a/mcopy.c
+++ b/mcopy.c
@@ -80,8 +80,91 @@ typedef struct Arg_t {
MainParam_t mp;
ClashHandling_t ch;
int noClobber;
+
+ const char *unixTarget; /* directory on Unix where to put files,
+ * needed by mcopy */
} Arg_t;
+static char *buildUnixFilename(Arg_t *arg)
+{
+ const char *target;
+ char *ret;
+ char *tmp;
+
+ target = mpPickTargetName(&arg->mp);
+ ret = malloc(strlen(arg->unixTarget) + 2 + strlen(target));
+ if(!ret)
+ return 0;
+ strcpy(ret, arg->unixTarget);
+ strcat(ret, "/");
+ if(*target) {
+ if(!strcmp(target, ".")) {
+ target="DOT";
+ } else if(!strcmp(target, "..")) {
+ target="DOTDOT";
+ }
+ while( (tmp=strchr(target, '/')) ) {
+ strncat(ret, target, ptrdiff(tmp,target));
+ strcat(ret, "\\");
+ target=tmp+1;
+ }
+ strcat(ret, target);
+ }
+ return ret;
+}
+
+/*
+ * Is target a Unix directory
+ * -1 error occured
+ * 0 regular file
+ * 1 directory
+ */
+static int unix_is_dir(const char *name)
+{
+ struct stat buf;
+ if(stat(name, &buf) < 0)
+ return -1;
+ else
+ return 1 && S_ISDIR(buf.st_mode);
+}
+
+static int unix_target_lookup(Arg_t *arg, const char *in)
+{
+ char *ptr;
+ arg->unixTarget = strdup(in);
+ /* try complete filename */
+ if(access(arg->unixTarget, F_OK) == 0) {
+ switch(unix_is_dir(arg->unixTarget)) {
+ case -1:
+ return ERROR_ONE;
+ case 0:
+ break;
+ default:
+ return GOT_ONE;
+ }
+ } else if(errno != ENOENT)
+ return ERROR_ONE;
+
+ ptr = strrchr(arg->unixTarget, '/');
+ if(!ptr) {
+ arg->mp.targetName = arg->unixTarget;
+ arg->unixTarget = strdup(".");
+ return GOT_ONE;
+ } else {
+ *ptr = '\0';
+ arg->mp.targetName = ptr+1;
+ return GOT_ONE;
+ }
+}
+
+int target_lookup(Arg_t *arg, const char *in)
+{
+ if(in[0] && in[1] == ':' )
+ return dos_target_lookup(&arg->mp, in);
+ else
+ return unix_target_lookup(arg, in);
+}
+
static int _unix_write(MainParam_t *mp, int needfilter, const char *unixFile);
/* Write the Unix file */
@@ -92,7 +175,7 @@ static int unix_write(MainParam_t *mp, int needfilter)
if(arg->type)
return _unix_write(mp, needfilter, "-");
else {
- char *unixFile = mpBuildUnixFilename(mp);
+ char *unixFile = buildUnixFilename(arg);
int ret;
if(!unixFile) {
printOom();
@@ -235,17 +318,17 @@ static int unix_copydir(direntry_t *entry, MainParam_t *mp)
}
if(got_signal)
return ERROR_ONE;
- unixFile = mpBuildUnixFilename(mp);
+ unixFile = buildUnixFilename(arg);
if(!unixFile) {
printOom();
return ERROR_ONE;
}
- if(arg->type || !*mpPickTargetName(mp) || !makeUnixDir(unixFile)) {
+ if(arg->type || !makeUnixDir(unixFile)) {
Arg_t newArg;
newArg = *arg;
newArg.mp.arg = (void *) &newArg;
- newArg.mp.unixTarget = unixFile;
+ newArg.unixTarget = unixFile;
newArg.mp.targetName = 0;
newArg.mp.basenameHasWildcard = 1;
@@ -254,10 +337,9 @@ static int unix_copydir(direntry_t *entry, MainParam_t *mp)
free(unixFile);
return ret | GOT_ONE;
} else {
- perror("mkdir");
fprintf(stderr,
- "Failure to make directory %s\n",
- unixFile);
+ "Failure to make directory %s: %s\n",
+ unixFile, strerror(errno));
free(unixFile);
return ERROR_ONE;
}
@@ -579,7 +661,9 @@ void mcopy(int argc, char **argv, int mtype)
usage(1);
init_mp(&arg.mp);
- arg.mp.lookupflags = ACCEPT_PLAIN | ACCEPT_DIR | DO_OPEN | NO_DOTS;
+ arg.unixTarget = 0;
+ arg.mp.lookupflags =
+ ACCEPT_PLAIN | ACCEPT_DIR | DO_OPEN | NO_DOTS | DEFERABLE;
arg.mp.fast_quit = fastquit;
arg.mp.arg = (void *) &arg;
arg.mp.openflags = O_RDONLY;
@@ -594,7 +678,7 @@ void mcopy(int argc, char **argv, int mtype)
if(mtype){
/* Mtype = copying to stdout */
arg.mp.targetName = strdup("-");
- arg.mp.unixTarget = strdup("");
+ arg.unixTarget = strdup("");
arg.mp.callback = dos_to_unix;
arg.mp.dirCallback = unix_copydir;
arg.mp.unixcallback = unix_to_unix;
@@ -610,14 +694,18 @@ void mcopy(int argc, char **argv, int mtype)
target = argv[argc];
}
- target_lookup(&arg.mp, target);
- if(!arg.mp.targetDir && !arg.mp.unixTarget) {
+ if(target_lookup(&arg, target) == ERROR_ONE) {
+ fprintf(stderr,"%s: %s\n", target, strerror(errno));
+ exit(1);
+
+ }
+ if(!arg.mp.targetDir && !arg.unixTarget) {
fprintf(stderr,"Bad target %s\n", target);
exit(1);
}
/* callback functions */
- if(arg.mp.unixTarget) {
+ if(arg.unixTarget) {
arg.mp.callback = dos_to_unix;
arg.mp.dirCallback = directory_dos_to_unix;
arg.mp.unixcallback = unix_to_unix;
diff --git a/mdel.1 b/mdel.1
index 62194fe..b22b59f 100644
--- a/mdel.1
+++ b/mdel.1
@@ -1,5 +1,5 @@
'\" t
-.TH mdel 1 "22Oct22" mtools-4.0.42
+.TH mdel 1 "21Mar23" mtools-4.0.43
.SH Name
mdel - delete an MSDOS file
'\" t
diff --git a/mdeltree.1 b/mdeltree.1
index 3deb7d2..0a0c54f 100644
--- a/mdeltree.1
+++ b/mdeltree.1
@@ -1,5 +1,5 @@
'\" t
-.TH mdeltree 1 "22Oct22" mtools-4.0.42
+.TH mdeltree 1 "21Mar23" mtools-4.0.43
.SH Name
mdeltree - recursively delete an MSDOS directory and its contents
'\" t
diff --git a/mdir.1 b/mdir.1
index c28b371..e00daf1 100644
--- a/mdir.1
+++ b/mdir.1
@@ -1,5 +1,5 @@
'\" t
-.TH mdir 1 "22Oct22" mtools-4.0.42
+.TH mdir 1 "21Mar23" mtools-4.0.43
.SH Name
mdir - display an MSDOS directory
'\" t
diff --git a/mdu.1 b/mdu.1
index afce7bc..6b1e320 100644
--- a/mdu.1
+++ b/mdu.1
@@ -1,5 +1,5 @@
'\" t
-.TH mdu 1 "22Oct22" mtools-4.0.42
+.TH mdu 1 "21Mar23" mtools-4.0.43
.SH Name
mdu - display the amount of space occupied by an MSDOS directory
'\" t
diff --git a/mformat.1 b/mformat.1
index 25b2a11..1d3d7e7 100644
--- a/mformat.1
+++ b/mformat.1
@@ -1,5 +1,5 @@
'\" t
-.TH mformat 1 "22Oct22" mtools-4.0.42
+.TH mformat 1 "21Mar23" mtools-4.0.43
.SH Name
mformat - add an MSDOS filesystem to a low-level formatted floppy disk
'\" t
@@ -227,6 +227,11 @@ descriptor is stored at position 21 of the boot sector, and as first
byte in each FAT copy. Using this option may confuse DOS or older mtools
version, and may make the disk unreadable. Only use if you know what you
are doing.
+.TP
+\&\fR\&\f(CWb\fR\
+Use a non-standard bios disk number for this disk. By default, bios
+disk number is inferred from media descriptor: 0x80 for media
+descriptor 0xf8, or 0x00 otherwise.
.PP
To format a diskette at a density other than the default, you must supply
(at least) those command line parameters that are different from the
diff --git a/mformat.c b/mformat.c
index 9756eea..56441d8 100644
--- a/mformat.c
+++ b/mformat.c
@@ -22,7 +22,6 @@
#include "sysincludes.h"
#include "mtools.h"
-#include "mainloop.h"
#include "device.h"
#include "old_dos.h"
#include "fsP.h"
@@ -904,6 +903,9 @@ void mformat(int argc, char **argv, int dummy UNUSEDP)
uint8_t mediaDesc=0;
bool haveMediaDesc=false;
+ uint8_t biosDisk=0;
+ bool haveBiosDisk=false;
+
mt_off_t maxSize;
int Atari = 0; /* should we add an Atari-style serial number ? */
@@ -944,8 +946,8 @@ void mformat(int argc, char **argv, int dummy UNUSEDP)
if(helpFlag(argc, argv))
usage(0);
while ((c = getopt(argc,argv,
- "i:148f:t:n:v:qub"
- "kK:R:B:r:L:I:FCc:Xh:s:T:l:N:H:M:S:2:30:Aad:m:"))!= EOF) {
+ "i:148f:t:n:v:qu"
+ "b:kK:R:B:r:L:I:FCc:Xh:s:T:l:N:H:M:S:2:30:Aad:m:"))!= EOF) {
errno = 0;
endptr = NULL;
switch (c) {
@@ -997,12 +999,14 @@ void mformat(int argc, char **argv, int dummy UNUSEDP)
/* flags supported by Dos but not mtools */
case 'q':
case 'u':
- case 'b':
/*case 's': leave this for compatibility */
fprintf(stderr,
"Flag %c not supported by mtools\n",c);
exit(1);
+ case 'b':
+ haveBiosDisk=1;
+ biosDisk = atou8(optarg);
/* flags added by mtools */
@@ -1256,7 +1260,7 @@ void mformat(int argc, char **argv, int dummy UNUSEDP)
}
if(tot_sectors == 0) {
- fprintf(stderr, "Number of sectors not known\n");
+ fprintf(stderr, "Disk size not known\n");
exit(1);
}
@@ -1369,10 +1373,14 @@ void mformat(int argc, char **argv, int dummy UNUSEDP)
if(Fs->cp == NULL)
exit(1);
- if (!keepBoot)
- /* only zero out physdrive if we don't have a template
+ if(haveMediaDesc)
+ boot.boot.descr=mediaDesc;
+ if(haveBiosDisk)
+ labelBlock->physdrive = biosDisk;
+ else if (!keepBoot)
+ /* only set physdrive if we don't have a template
* bootsector */
- labelBlock->physdrive = 0x00;
+ labelBlock->physdrive = (boot.boot.descr == 0xf8) ? 0x80 : 0x00;
labelBlock->reserved = 0;
labelBlock->dos4 = 0x29;
@@ -1419,8 +1427,6 @@ void mformat(int argc, char **argv, int dummy UNUSEDP)
}
if(used_dev.use_2m & 0x7f)
Fs->num_fat = 1;
- if(haveMediaDesc)
- boot.boot.descr=mediaDesc;
Fs->lastFatSectorNr = 0;
Fs->lastFatSectorData = 0;
zero_fat(Fs, boot.boot.descr);
diff --git a/minfo.1 b/minfo.1
index d4a6275..f6a8405 100644
--- a/minfo.1
+++ b/minfo.1
@@ -1,5 +1,5 @@
'\" t
-.TH minfo 1 "22Oct22" mtools-4.0.42
+.TH minfo 1 "21Mar23" mtools-4.0.43
.SH Name
minfo - print the parameters of a MSDOS filesystem
'\" t
diff --git a/mk_direntry.c b/mk_direntry.c
index ab55489..85fa413 100644
--- a/mk_direntry.c
+++ b/mk_direntry.c
@@ -29,7 +29,6 @@
#include "nameclash.h"
#include "fs.h"
#include "stream.h"
-#include "mainloop.h"
#include "file_name.h"
/**
diff --git a/mkmanifest.1 b/mkmanifest.1
index 3b832e4..5ac94c6 100644
--- a/mkmanifest.1
+++ b/mkmanifest.1
@@ -1,5 +1,5 @@
'\" t
-.TH mkmanifest 1 "22Oct22" mtools-4.0.42
+.TH mkmanifest 1 "21Mar23" mtools-4.0.43
.SH Name
mkmanifest - makes list of file names and their DOS 8+3 equivalent
'\" t
diff --git a/mlabel.1 b/mlabel.1
index f9485d5..30d8508 100644
--- a/mlabel.1
+++ b/mlabel.1
@@ -1,5 +1,5 @@
'\" t
-.TH mlabel 1 "22Oct22" mtools-4.0.42
+.TH mlabel 1 "21Mar23" mtools-4.0.43
.SH Name
mlabel - make an MSDOS volume label
'\" t
diff --git a/mlabel.c b/mlabel.c
index 2d31069..629b072 100644
--- a/mlabel.c
+++ b/mlabel.c
@@ -20,10 +20,10 @@
*/
#include "sysincludes.h"
-#include "mainloop.h"
-#include "mtools.h"
#include "nameclash.h"
#include "file_name.h"
+#include "vfat.h"
+#include "stream.h"
static void _label_name(doscp_t *cp, const char *filename, int verbose UNUSEDP,
int *mangled, dos_name_t *ans, int preserve_case)
@@ -112,7 +112,6 @@ void mlabel(int argc, char **argv, int type UNUSEDP)
char longname[VBUFSIZE];
char shortname[45];
ClashHandling_t ch;
- struct MainParam_t mp;
Stream_t *RootDir;
int c;
int mangled;
@@ -189,7 +188,6 @@ void mlabel(int argc, char **argv, int type UNUSEDP)
drive = get_default_drive();
}
- init_mp(&mp);
if(strlen(newLabel) > VBUFSIZE) {
fprintf(stderr, "Label too long\n");
FREE(&RootDir);
diff --git a/mmd.1 b/mmd.1
index 3354285..06bc2da 100644
--- a/mmd.1
+++ b/mmd.1
@@ -1,5 +1,5 @@
'\" t
-.TH mmd 1 "22Oct22" mtools-4.0.42
+.TH mmd 1 "21Mar23" mtools-4.0.43
.SH Name
mmd - make an MSDOS subdirectory
'\" t
diff --git a/mmount.1 b/mmount.1
index 1e3bd5a..d4b83f1 100644
--- a/mmount.1
+++ b/mmount.1
@@ -1,5 +1,5 @@
'\" t
-.TH mmount 1 "22Oct22" mtools-4.0.42
+.TH mmount 1 "21Mar23" mtools-4.0.43
.SH Name
mmount - mount an MSDOS disk
'\" t
diff --git a/mmove.1 b/mmove.1
index ecc752b..b3b8217 100644
--- a/mmove.1
+++ b/mmove.1
@@ -1,5 +1,5 @@
'\" t
-.TH mmove 1 "22Oct22" mtools-4.0.42
+.TH mmove 1 "21Mar23" mtools-4.0.43
.SH Name
mmove - move or rename an MSDOS file or subdirectory
'\" t
diff --git a/mmove.c b/mmove.c
index 9914f31..7991bc5 100644
--- a/mmove.c
+++ b/mmove.c
@@ -291,11 +291,10 @@ void mmove(int argc, char **argv, int oldsyntax)
if (oldsyntax && (argc - optind != 2 || strpbrk(":/", argv[argc-1])))
oldsyntax = 0;
- arg.mp.lookupflags =
- ACCEPT_PLAIN | ACCEPT_DIR | DO_OPEN_DIRS | NO_DOTS | NO_UNIX;
+ arg.mp.lookupflags = ACCEPT_PLAIN | ACCEPT_DIR | DO_OPEN_DIRS | NO_DOTS;
if (!oldsyntax){
- target_lookup(&arg.mp, argv[argc-1]);
+ dos_target_lookup(&arg.mp, argv[argc-1]);
arg.mp.callback = rename_file;
arg.mp.dirCallback = rename_directory;
} else {
diff --git a/mpartition.1 b/mpartition.1
index be09f77..618b4cc 100644
--- a/mpartition.1
+++ b/mpartition.1
@@ -1,5 +1,5 @@
'\" t
-.TH mpartition 1 "22Oct22" mtools-4.0.42
+.TH mpartition 1 "21Mar23" mtools-4.0.43
.SH Name
mpartition - partition an MSDOS hard disk
'\" t
diff --git a/mpartition.c b/mpartition.c
index c218aac..56e2b6a 100644
--- a/mpartition.c
+++ b/mpartition.c
@@ -20,7 +20,6 @@
#include "sysincludes.h"
#include "mtools.h"
-#include "mainloop.h"
#include "fsP.h"
#include "file.h"
#include "plain_io.h"
diff --git a/mrd.1 b/mrd.1
index 0cc3758..46e2015 100644
--- a/mrd.1
+++ b/mrd.1
@@ -1,5 +1,5 @@
'\" t
-.TH mrd 1 "22Oct22" mtools-4.0.42
+.TH mrd 1 "21Mar23" mtools-4.0.43
.SH Name
mrd - remove an MSDOS subdirectory
'\" t
diff --git a/mren.1 b/mren.1
index cc6dcdb..4d56089 100644
--- a/mren.1
+++ b/mren.1
@@ -1,5 +1,5 @@
'\" t
-.TH mren 1 "22Oct22" mtools-4.0.42
+.TH mren 1 "21Mar23" mtools-4.0.43
.SH Name
mren - rename an existing MSDOS file
'\" t
diff --git a/mshortname.1 b/mshortname.1
index 61e5163..f58c23e 100644
--- a/mshortname.1
+++ b/mshortname.1
@@ -1,5 +1,5 @@
'\" t
-.TH mshortname 1 "22Oct22" mtools-4.0.42
+.TH mshortname 1 "21Mar23" mtools-4.0.43
.SH Name
mshortname - shows short name of a file
'\" t
diff --git a/mshowfat.1 b/mshowfat.1
index f551796..0312f8d 100644
--- a/mshowfat.1
+++ b/mshowfat.1
@@ -1,5 +1,5 @@
'\" t
-.TH mshowfat 1 "22Oct22" mtools-4.0.42
+.TH mshowfat 1 "21Mar23" mtools-4.0.43
.SH Name
mshowfat - shows FAT clusters allocated to file
'\" t
diff --git a/mtools.1 b/mtools.1
index dd0bc14..09eadd7 100644
--- a/mtools.1
+++ b/mtools.1
@@ -1,5 +1,5 @@
'\" t
-.TH mtools 1 "22Oct22" mtools-4.0.42
+.TH mtools 1 "21Mar23" mtools-4.0.43
.SH Name
mtools - utilities to access DOS disks in Unix.
'\" t
@@ -36,7 +36,7 @@ Mtools can be found at the following places (and their mirrors):
.nf
.ft 3
.in +0.3i
-http://ftp.gnu.org/gnu/mtools/mtools-4.0.42.tar.gz
+http://ftp.gnu.org/gnu/mtools/mtools-4.0.43.tar.gz
.fi
.in -0.3i
.ft R
diff --git a/mtools.5 b/mtools.5
index a40f94b..166aa90 100644
--- a/mtools.5
+++ b/mtools.5
@@ -1,5 +1,5 @@
'\" t
-.TH mtools 5 "22Oct22" MTOOLS MTOOLS
+.TH mtools 5 "21Mar23" MTOOLS MTOOLS
.SH Name
mtools.conf - mtools configuration files
'\" t
@@ -13,7 +13,7 @@ mtools.conf - mtools configuration files
.tr \(if`
.tr \(pd"
-.ds St Mtools\ 4.0.42
+.ds St Mtools\ 4.0.43
.PP
.SH Description
.PP
diff --git a/mtools.info b/mtools.info
index 0828fe7..9ba974b 100644
--- a/mtools.info
+++ b/mtools.info
@@ -1,6 +1,6 @@
This is mtools.info, produced by makeinfo version 6.7 from mtools.texi.
-This manual is for Mtools (version 4.0.42, October 2022), which is a
+This manual is for Mtools (version 4.0.43, March 2023), which is a
collection of tools to allow Unix systems to manipulate MS-DOS files.
Copyright (C) 2007, 2009 Free Software Foundation, Inc. Copyright
@@ -53,7 +53,7 @@ preliminary mounting or initialization (assuming the default
'/etc/mtools.conf' works on your machine). With mtools, one can change
floppies too without unmounting and mounting.
- This manual is for Mtools (version 4.0.42, October 2022), which is a
+ This manual is for Mtools (version 4.0.43, March 2023), which is a
collection of tools to allow Unix systems to manipulate MS-DOS files.
Copyright (C) 2007, 2009 Free Software Foundation, Inc. Copyright
@@ -87,7 +87,7 @@ File: mtools.info, Node: Location, Next: Common features, Prev: Top, Up: Top
*********************
Mtools can be found at the following places (and their mirrors):
- http://ftp.gnu.org/gnu/mtools/mtools-4.0.42.tar.gz
+ http://ftp.gnu.org/gnu/mtools/mtools-4.0.43.tar.gz
These patches are named 'mtools-'VERSION'-'DDMM'.taz', where version
stands for the base version, DD for the day and MM for the month. Due
@@ -1718,6 +1718,11 @@ has a different meaning.
older mtools version, and may make the disk unreadable. Only use
if you know what you are doing.
+'b'
+ Use a non-standard bios disk number for this disk. By default,
+ bios disk number is inferred from media descriptor: 0x80 for media
+ descriptor 0xf8, or 0x00 otherwise.
+
To format a diskette at a density other than the default, you must
supply (at least) those command line parameters that are different from
the default.
@@ -2707,71 +2712,71 @@ Concept index

Tag Table:
-Node: Top871
-Node: Location3127
-Node: Common features4065
-Node: arguments4829
-Node: drive letters6594
-Node: directory7948
-Node: long names8394
-Node: name clashes10940
-Node: case sensitivity13224
-Node: high capacity formats14461
-Node: more sectors15506
-Node: bigger sectors16561
-Node: 2m17290
-Node: XDF18476
-Node: exit codes19819
-Node: bugs20457
-Node: Configuration20990
-Node: configuration file location22279
-Node: general syntax22732
-Node: default values23563
-Node: global variables24091
-Node: per drive variables26284
-Node: general information27119
-Node: location information27561
-Node: geometry description29090
-Node: open flags32951
-Node: miscellaneous variables33551
-Node: miscellaneous flags37421
-Node: multiple descriptions41051
-Node: parsing order42725
-Node: old style configuration43756
-Node: Commands44455
-Node: floppyd46336
-Node: floppyd_installtest51129
-Node: mattrib51760
-Node: mbadblocks53552
-Node: mcat54846
-Node: mcd55660
-Node: mcopy56515
-Node: mdel59525
-Node: mdeltree59864
-Node: mdir60281
-Node: mdu61557
-Node: mformat62063
-Node: mkmanifest70574
-Node: minfo72548
-Node: mlabel73118
-Node: mmd74271
-Node: mmount74620
-Node: mmove75223
-Node: mpartition76028
-Node: mrd81554
-Node: mren81912
-Node: mshortname82661
-Node: mshowfat82991
-Node: mtoolstest83400
-Node: mtype83972
-Node: mzip84823
-Ref: mzip-Footnote-186848
-Ref: mzip-Footnote-286929
-Node: Compiling mtools87216
-Node: Porting mtools88315
-Node: Command Index94223
-Node: Variable Index94351
-Node: Concept Index96174
+Node: Top869
+Node: Location3123
+Node: Common features4061
+Node: arguments4825
+Node: drive letters6590
+Node: directory7944
+Node: long names8390
+Node: name clashes10936
+Node: case sensitivity13220
+Node: high capacity formats14457
+Node: more sectors15502
+Node: bigger sectors16557
+Node: 2m17286
+Node: XDF18472
+Node: exit codes19815
+Node: bugs20453
+Node: Configuration20986
+Node: configuration file location22275
+Node: general syntax22728
+Node: default values23559
+Node: global variables24087
+Node: per drive variables26280
+Node: general information27115
+Node: location information27557
+Node: geometry description29086
+Node: open flags32947
+Node: miscellaneous variables33547
+Node: miscellaneous flags37417
+Node: multiple descriptions41047
+Node: parsing order42721
+Node: old style configuration43752
+Node: Commands44451
+Node: floppyd46332
+Node: floppyd_installtest51125
+Node: mattrib51756
+Node: mbadblocks53548
+Node: mcat54842
+Node: mcd55656
+Node: mcopy56511
+Node: mdel59521
+Node: mdeltree59860
+Node: mdir60277
+Node: mdu61553
+Node: mformat62059
+Node: mkmanifest70757
+Node: minfo72731
+Node: mlabel73301
+Node: mmd74454
+Node: mmount74803
+Node: mmove75406
+Node: mpartition76211
+Node: mrd81737
+Node: mren82095
+Node: mshortname82844
+Node: mshowfat83174
+Node: mtoolstest83583
+Node: mtype84155
+Node: mzip85006
+Ref: mzip-Footnote-187031
+Ref: mzip-Footnote-287112
+Node: Compiling mtools87399
+Node: Porting mtools88498
+Node: Command Index94406
+Node: Variable Index94534
+Node: Concept Index96357

End Tag Table
diff --git a/mtools.spec b/mtools.spec
index 4759d4f..3df02a7 100644
--- a/mtools.spec
+++ b/mtools.spec
@@ -1,7 +1,7 @@
%define _binary_payload w9.gzdio
Name: mtools
Summary: mtools, read/write/list/format DOS disks under Unix
-Version: 4.0.42
+Version: 4.0.43
Release: 1
License: GPLv3+
Group: Utilities/System
@@ -133,6 +133,15 @@ if [ -f %{_bindir}/install-info ] ; then
fi
%changelog
+* Tue Mar 21 2023 Alain Knaff <alain@knaff.lu>
+- Fix root directory test in mattrib
+- -b BiosDisk flag for mformat to allow setting physdrive to a user-specified
+ value
+- Clearer error message in mformat when trying to mformat a disk whose total
+ size is not known
+- Make recursive copy more consistent
+- Trailing slash now always implies target should be a directory
+- Code cleanup
* Sat Oct 22 2022 Alain Knaff <alain@knaff.lu>
- Added postcmd attribute in drive description to allow to
execute "device release" code automatically at end of command
diff --git a/mtools.texi b/mtools.texi
index bdb3c5d..83676a6 100644
--- a/mtools.texi
+++ b/mtools.texi
@@ -1922,6 +1922,11 @@ byte in each FAT copy. Using this option may confuse DOS or older mtools
version, and may make the disk unreadable. Only use if you know what you
are doing.
+@item b
+Use a non-standard bios disk number for this disk. By default, bios
+disk number is inferred from media descriptor: 0x80 for media
+descriptor 0xf8, or 0x00 otherwise.
+
@end table
To format a diskette at a density other than the default, you must supply
diff --git a/mtools.tmpl.1 b/mtools.tmpl.1
index dae8c24..dcb0a02 100644
--- a/mtools.tmpl.1
+++ b/mtools.tmpl.1
@@ -1,5 +1,5 @@
'\" t
-.TH mtools 1 "22Oct22" mtools-4.0.42
+.TH mtools 1 "21Mar23" mtools-4.0.43
.SH Name
mtools - utilities to access DOS disks in Unix.
'\" t
@@ -36,7 +36,7 @@ Mtools can be found at the following places (and their mirrors):
.nf
.ft 3
.in +0.3i
-http://ftp.gnu.org/gnu/mtools/mtools-4.0.42.tar.gz
+http://ftp.gnu.org/gnu/mtools/mtools-4.0.43.tar.gz
.fi
.in -0.3i
.ft R
diff --git a/mtools.tmpl.5 b/mtools.tmpl.5
index 67687a0..6c117d4 100644
--- a/mtools.tmpl.5
+++ b/mtools.tmpl.5
@@ -1,5 +1,5 @@
'\" t
-.TH mtools 5 "22Oct22" MTOOLS MTOOLS
+.TH mtools 5 "21Mar23" MTOOLS MTOOLS
.SH Name
mtools.conf - mtools configuration files
'\" t
@@ -13,7 +13,7 @@ mtools.conf - mtools configuration files
.tr \(if`
.tr \(pd"
-.ds St Mtools\ 4.0.42
+.ds St Mtools\ 4.0.43
.PP
.SH Description
.PP
diff --git a/mtoolstest.1 b/mtoolstest.1
index 7165551..c107043 100644
--- a/mtoolstest.1
+++ b/mtoolstest.1
@@ -1,5 +1,5 @@
'\" t
-.TH mtoolstest 1 "22Oct22" mtools-4.0.42
+.TH mtoolstest 1 "21Mar23" mtools-4.0.43
.SH Name
mtoolstest - tests and displays the configuration
'\" t
diff --git a/mtype.1 b/mtype.1
index 4d37275..39b8900 100644
--- a/mtype.1
+++ b/mtype.1
@@ -1,5 +1,5 @@
'\" t
-.TH mtype 1 "22Oct22" mtools-4.0.42
+.TH mtype 1 "21Mar23" mtools-4.0.43
.SH Name
mtype - display contents of an MSDOS file
'\" t
diff --git a/mzip.1 b/mzip.1
index a210776..10e0072 100644
--- a/mzip.1
+++ b/mzip.1
@@ -1,5 +1,5 @@
'\" t
-.TH mzip 1 "22Oct22" mtools-4.0.42
+.TH mzip 1 "21Mar23" mtools-4.0.43
.SH Name
mzip - change protection mode and eject disk on Zip/Jaz drive
'\" t
diff --git a/nameclash.h b/nameclash.h
index d919b22..34de254 100644
--- a/nameclash.h
+++ b/nameclash.h
@@ -57,8 +57,8 @@ typedef struct ClashHandling_t {
int is_label;
} ClashHandling_t;
-#ifdef MTOOLS_DIRENTRY_H
/* write callback */
+struct direntry_t;
typedef int (write_data_callback)(dos_name_t *,char *, void *, struct direntry_t *);
int mwrite_one(Stream_t *Dir,
@@ -67,7 +67,6 @@ int mwrite_one(Stream_t *Dir,
write_data_callback *cb,
void *arg,
ClashHandling_t *ch);
-#endif
int handle_clash_options(ClashHandling_t *ch, int c);
void init_clash_handling(ClashHandling_t *ch);
diff --git a/patchlevel.c b/patchlevel.c
index 905f2fd..c6e398b 100644
--- a/patchlevel.c
+++ b/patchlevel.c
@@ -18,10 +18,10 @@
#include "sysincludes.h"
#include "mtools.h"
-const char *mversion="4.0.42";
+const char *mversion="4.0.43";
/* Multiple releases on same day should be marked with (b), (cd), (d) after
* date string below */
-const char *mdate = "October 22nd, 2022";
+const char *mdate = "March 21st, 2023";
-const char *mformat_banner = "MTOO4042";
+const char *mformat_banner = "MTOO4043";
diff --git a/stream.h b/stream.h
index 9bc0e08..9ad5717 100644
--- a/stream.h
+++ b/stream.h
@@ -115,4 +115,6 @@ int getfreeMinBytes(Stream_t *Stream, mt_off_t ref);
int adjust_tot_sectors(struct device *dev, mt_off_t offset, char *errmsg);
+Stream_t *open_root_dir(char drivename, int flags, int *isRop);
+
#endif
diff --git a/streamcache.c b/streamcache.c
index 0bf684c..aa55d1b 100644
--- a/streamcache.c
+++ b/streamcache.c
@@ -21,7 +21,6 @@
#include "sysincludes.h"
#include "mtools.h"
#include "fs.h"
-#include "mainloop.h"
#include "plain_io.h"
#include "file.h"
diff --git a/texinfo.tex b/texinfo.tex
index 9ad8faf..0b8b87c 100644
--- a/texinfo.tex
+++ b/texinfo.tex
@@ -1,11 +1,11 @@
% texinfo.tex -- TeX macros to handle Texinfo files.
-%
+%
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2022-10-01.15}
+\def\texinfoversion{2023-03-21.06}
%
-% Copyright 1985, 1986, 1988, 1990-2022 Free Software Foundation, Inc.
+% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@@ -58,12 +58,6 @@
\message{Loading texinfo [version \texinfoversion]:}
-% If in a .fmt file, print the version number
-% and turn on active characters that we couldn't do earlier because
-% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}%
- \catcode`+=\active \catcode`\_=\active}
-
% LaTeX's \typeout. This ensures that the messages it is used for
% are identical in format to the corresponding ones from latex/pdflatex.
\def\typeout{\immediate\write17}%
@@ -218,7 +212,7 @@
% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
% aren't perfect, it's not the end of the world, being an error message,
% after all.
-%
+%
\def\errormsg{\begingroup \indexnofonts \doerrormsg}
\def\doerrormsg#1{\errmessage{#1}}
@@ -432,7 +426,7 @@
}%
}
-% First remove any @comment, then any @c comment. Pass the result on to
+% First remove any @comment, then any @c comment. Pass the result on to
% \argcheckspaces.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
@@ -530,7 +524,7 @@
% ... but they get defined via ``\envdef\foo{...}'':
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
-\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+\long\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
% Check whether we're in the right environment:
\def\checkenv#1{%
@@ -591,6 +585,9 @@
% @/ allows a line break.
\let\/=\allowbreak
+% @- allows explicit insertion of hyphenation points
+\def\-{\discretionary{\normaldash}{}{}}%
+
% @. is an end-of-sentence period.
\def\.{.\spacefactor=\endofsentencespacefactor\space}
@@ -1051,8 +1048,8 @@ where each line of input produces a line of output.}
end
end
}
- % The -2 in the arguments here gives all the input to TeX catcode 12
- % (other) or 10 (space), preventing undefined control sequence errors. See
+ % The -2 in the arguments here gives all the input to TeX catcode 12
+ % (other) or 10 (space), preventing undefined control sequence errors. See
% https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
%
\endgroup
@@ -1146,7 +1143,7 @@ where each line of input produces a line of output.}
% for display in the outlines, and in other places. Thus, we have to
% double any backslashes. Otherwise, a name like "\node" will be
% interpreted as a newline (\n), followed by o, d, e. Not good.
-%
+%
% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
% related messages. The final outcome is that it is up to the TeX user
% to double the backslashes and otherwise make the string valid, so
@@ -1197,13 +1194,17 @@ output) for that.)}
%
% Set color, and create a mark which defines \thiscolor accordingly,
% so that \makeheadline knows which color to restore.
+ \def\curcolor{0 0 0}%
\def\setcolor#1{%
- \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
- \domark
- \pdfsetcolor{#1}%
+ \ifx#1\curcolor\else
+ \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \domark
+ \pdfsetcolor{#1}%
+ \xdef\curcolor{#1}%
+ \fi
}
%
- \def\maincolor{\rgbBlack}
+ \let\maincolor\rgbBlack
\pdfsetcolor{\maincolor}
\edef\thiscolor{\maincolor}
\def\currentcolordefs{}
@@ -1359,7 +1360,7 @@ output) for that.)}
%
% by default, use black for everything.
\def\urlcolor{\rgbBlack}
- \def\linkcolor{\rgbBlack}
+ \let\linkcolor\rgbBlack
\def\endlink{\setcolor{\maincolor}\pdfendlink}
%
% Adding outlines to PDF; macros for calculating structure of outlines
@@ -1434,7 +1435,7 @@ output) for that.)}
% We use the node names as the destinations.
%
% Currently we prefix the section name with the section number
- % for chapter and appendix headings only in order to avoid too much
+ % for chapter and appendix headings only in order to avoid too much
% horizontal space being required in the PDF viewer.
\def\numchapentry##1##2##3##4{%
\dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
@@ -1457,7 +1458,7 @@ output) for that.)}
% their "best" equivalent, based on the @documentencoding. Too
% much work for too little return. Just use the ASCII equivalents
% we use for the index sort strings.
- %
+ %
\indexnofonts
\setupdatafile
% We can have normal brace characters in the PDF outlines, unlike
@@ -1537,9 +1538,10 @@ output) for that.)}
\next}
\def\makelink{\addtokens{\toksB}%
{\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
- \def\pdflink#1{%
+ \def\pdflink#1{\pdflinkpage{#1}{#1}}%
+ \def\pdflinkpage#1#2{%
\startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
- \setcolor{\linkcolor}#1\endlink}
+ \setcolor{\linkcolor}#2\endlink}
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\else
% non-pdf mode
@@ -1682,7 +1684,7 @@ output) for that.)}
% We use node names as destinations.
%
% Currently we prefix the section name with the section number
- % for chapter and appendix headings only in order to avoid too much
+ % for chapter and appendix headings only in order to avoid too much
% horizontal space being required in the PDF viewer.
\def\partentry##1##2##3##4{}% ignore parts in the outlines
\def\numchapentry##1##2##3##4{%
@@ -1786,10 +1788,11 @@ output) for that.)}
\next}
\def\makelink{\addtokens{\toksB}%
{\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
- \def\pdflink#1{%
+ \def\pdflink#1{\pdflinkpage{#1}{#1}}%
+ \def\pdflinkpage#1#2{%
\special{pdf:bann << /Border [0 0 0]
/Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
- \setcolor{\linkcolor}#1\endlink}
+ \setcolor{\linkcolor}#2\endlink}
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
%
%
@@ -2134,6 +2137,11 @@ end
\pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
}%
\fi\fi
+%
+% This is what gets called when #5 of \setfont is empty.
+\let\cmap\gobble
+%
+% (end of cmaps)
% Set the font macro #1 to the font named \fontprefix#2.
@@ -2149,11 +2157,10 @@ end
\def\setfont#1#2#3#4#5{%
\font#1=\fontprefix#2#3 scaled #4
\csname cmap#5\endcsname#1%
+ \ifx#2\ttshape\hyphenchar#1=-1 \fi
+ \ifx#2\ttbshape\hyphenchar#1=-1 \fi
+ \ifx#2\ttslshape\hyphenchar#1=-1 \fi
}
-% This is what gets called when #5 of \setfont is empty.
-\let\cmap\gobble
-%
-% (end of cmaps)
% Use cm as the default font prefix.
% To specify the font prefix, you must define \fontprefix
@@ -2674,26 +2681,23 @@ end
\gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
\gdef\setregularquotes{\let`\lq \let'\rq}
}
+\setregularquotes
-% Allow an option to not use regular directed right quote/apostrophe
-% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
-% The undirected quote is ugly, so don't make it the default, but it
-% works for pasting with more pdf viewers (at least evince), the
-% lilypond developers report. xpdf does work with the regular 0x27.
+% output for ' in @code
+% in tt font hex 0D (undirected) or 27 (curly right quote)
%
\def\codequoteright{%
\ifusingtt
{\ifflagclear{txicodequoteundirected}%
{\ifflagclear{codequoteundirected}%
{'}%
- {\char'15 }}%
- {\char'15 }}%
+ {\char"0D }}%
+ {\char"0D }}%
{'}%
}
-% and a similar option for the left quote char vs. a grave accent.
-% Modern fonts display ASCII 0x60 as a grave accent, so some people like
-% the code environments to do likewise.
+% output for ` in @code
+% in tt font hex 12 (grave accent) or 60 (curly left quote)
% \relax disables Spanish ligatures ?` and !` of \tt font.
%
\def\codequoteleft{%
@@ -2701,13 +2705,13 @@ end
{\ifflagclear{txicodequotebacktick}%
{\ifflagclear{codequotebacktick}%
{\relax`}%
- {\char'22 }}%
- {\char'22 }}%
+ {\char"12 }}%
+ {\char"12 }}%
{\relax`}%
}
% Commands to set the quote options.
-%
+%
\parseargdef\codequoteundirected{%
\def\temp{#1}%
\ifx\temp\onword
@@ -2721,7 +2725,7 @@ end
\errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
\fi\fi
}
-%
+
\parseargdef\codequotebacktick{%
\def\temp{#1}%
\ifx\temp\onword
@@ -2736,6 +2740,11 @@ end
\fi\fi
}
+% Turn them on by default
+\let\SETtxicodequoteundirected = t
+\let\SETtxicodequotebacktick = t
+
+
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
\def\noligaturesquoteleft{\relax\lq}
@@ -2748,7 +2757,7 @@ end
% If we are in a monospaced environment, however, 1) always use \ttsl,
% and 2) do not add an italic correction.
\def\dosmartslant#1#2{%
- \ifusingtt
+ \ifusingtt
{{\ttsl #2}\let\next=\relax}%
{\def\next{{#1#2}\smartitaliccorrection}}%
\next
@@ -2815,13 +2824,6 @@ end
% @sansserif, explicit sans.
\def\sansserif#1{{\sf #1}}
-% We can't just use \exhyphenpenalty, because that only has effect at
-% the end of a paragraph. Restore normal hyphenation at the end of the
-% group within which \nohyphenation is presumably called.
-%
-\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
-\def\restorehyphenation{\hyphenchar\font = `- }
-
\newif\iffrenchspacing
\frenchspacingfalse
@@ -2890,27 +2892,29 @@ end
% Switch to typewriter.
\tt
%
- % But `\ ' produces the large typewriter interword space.
+ % `\ ' produces the large typewriter interword space.
\def\ {{\spaceskip = 0pt{} }}%
%
- % Turn off hyphenation.
- \nohyphenation
- %
\plainfrenchspacing
#1%
}%
\null % reset spacefactor to 1000
}
-% We *must* turn on hyphenation at `-' and `_' in @code.
-% (But see \codedashfinish below.)
+% This is for LuaTeX: It is not sufficient to disable hyphenation at
+% explicit dashes by setting `\hyphenchar` to -1.
+\def\dashnobreak{%
+ \normaldash
+ \penalty 10000 }
+
+% We must turn on hyphenation at `-' and `_' in @code.
% Otherwise, it is too hard to avoid overfull hboxes
% in the Emacs manual, the Library manual, etc.
+% We explicitly allow hyphenation at these characters
+% using \discretionary.
%
-% Unfortunately, TeX uses one parameter (\hyphenchar) to control
-% both hyphenation at - and hyphenation within words.
-% We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate at a dash. -- rms.
+% Hyphenation at - and hyphenation within words was turned off
+% by default for the tt fonts using the \hyphenchar parameter of TeX.
{
\catcode`\-=\active \catcode`\_=\active
\catcode`\'=\active \catcode`\`=\active
@@ -2923,37 +2927,42 @@ end
\let-\codedash
\let_\codeunder
\else
- \let-\normaldash
+ \let-\dashnobreak
\let_\realunder
\fi
- % Given -foo (with a single dash), we do not want to allow a break
- % after the hyphen.
- \global\let\codedashprev=\codedash
- %
\codex
}
%
\gdef\codedash{\futurelet\next\codedashfinish}
\gdef\codedashfinish{%
\normaldash % always output the dash character itself.
- %
+ %
% Now, output a discretionary to allow a line break, unless
% (a) the next character is a -, or
- % (b) the preceding character is a -.
+ % (b) the preceding character is a -, or
+ % (c) we are at the start of the string.
+ % In both cases (b) and (c), \codedashnobreak should be set to \codedash.
+ %
% E.g., given --posix, we do not want to allow a break after either -.
% Given --foo-bar, we do want to allow a break between the - and the b.
\ifx\next\codedash \else
- \ifx\codedashprev\codedash
+ \ifx\codedashnobreak\codedash
\else \discretionary{}{}{}\fi
\fi
% we need the space after the = for the case when \next itself is a
% space token; it would get swallowed otherwise. As in @code{- a}.
- \global\let\codedashprev= \next
+ \global\let\codedashnobreak= \next
}
}
\def\normaldash{-}
%
-\def\codex #1{\tclose{#1}\endgroup}
+\def\codex #1{\tclose{%
+ % Given -foo (with a single dash), we do not want to allow a break
+ % after the -. \codedashnobreak is set to the first character in
+ % @code.
+ \futurelet\codedashnobreak\relax
+ #1%
+}\endgroup}
\def\codeunder{%
% this is all so @math{@code{var_name}+1} can work. In math mode, _
@@ -3033,7 +3042,7 @@ end
% For pdfTeX and LuaTeX
\ifurefurlonlylink
% PDF plus option to not display url, show just arg
- \unhbox0
+ \unhbox0
\else
% PDF, normally display both arg and url for consistency,
% visibility, if the pdf is eventually used to print, etc.
@@ -3046,7 +3055,7 @@ end
% For XeTeX
\ifurefurlonlylink
% PDF plus option to not display url, show just arg
- \unhbox0
+ \unhbox0
\else
% PDF, normally display both arg and url for consistency,
% visibility, if the pdf is eventually used to print, etc.
@@ -3104,10 +3113,10 @@ end
}
}
-% By default we'll break after the special characters, but some people like to
-% break before the special chars, so allow that. Also allow no breaking at
+% By default we'll break after the special characters, but some people like to
+% break before the special chars, so allow that. Also allow no breaking at
% all, for manual control.
-%
+%
\parseargdef\urefbreakstyle{%
\def\txiarg{#1}%
\ifx\txiarg\wordnone
@@ -3126,10 +3135,10 @@ end
\def\wordnone{none}
% Allow a ragged right output to aid breaking long URL's. There can
-% be a break at the \allowbreak with no extra glue (if the existing stretch in
+% be a break at the \allowbreak with no extra glue (if the existing stretch in
% the line is sufficient), a break at the \penalty with extra glue added
% at the end of the line, or no break at all here.
-% Changing the value of the penalty and/or the amount of stretch affects how
+% Changing the value of the penalty and/or the amount of stretch affects how
% preferable one choice is over the other.
\def\urefallowbreak{%
\penalty0\relax
@@ -3200,7 +3209,7 @@ end
% definition of @key with no lozenge.
%
-\def\key#1{{\setregularquotes \nohyphenation \tt #1}\null}
+\def\key#1{{\setregularquotes \tt #1}\null}
% @clicksequence{File @click{} Open ...}
\def\clicksequence#1{\begingroup #1\endgroup}
@@ -3344,7 +3353,7 @@ $$%
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
% except specified as a normal braced arg, so no newlines to worry about.
-%
+%
\def\outfmtnametex{tex}
%
\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
@@ -3352,7 +3361,7 @@ $$%
\def\inlinefmtname{#1}%
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
}
-%
+%
% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
% FMTNAME is tex, else ELSE-TEXT.
\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
@@ -3368,7 +3377,7 @@ $$%
% *right* brace they would have to use a command anyway, so they may as
% well use a command to get a left brace too. We could re-use the
% delimiter character idea from \verb, but it seems like overkill.
-%
+%
\long\def\inlineraw{\tex \doinlineraw}
\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
\def\doinlinerawtwo#1,#2,\finish{%
@@ -3654,7 +3663,7 @@ $$%
% for non-CM glyphs. That is ec* for regular text and tc* for the text
% companion symbols (LaTeX TS1 encoding). Both are part of the ec
% package and follow the same conventions.
-%
+%
\def\ecfont{\etcfont{e}}
\def\tcfont{\etcfont{t}}
%
@@ -3691,7 +3700,10 @@ $$%
% @textdegree - the normal degrees sign.
%
-\def\textdegree{$^\circ$}
+\def\textdegree{%
+ \ifmmode ^\circ
+ \else {\tcfont \char 176}%
+ \fi}
% Laurent Siebenmann reports \Orb undefined with:
% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
@@ -3733,17 +3745,18 @@ $$%
after the title page.}}%
\def\setshortcontentsaftertitlepage{%
\errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
- command; move your @shortcontents and @contents commands if you
+ command; move your @shortcontents and @contents commands if you
want the contents after the title page.}}%
\parseargdef\shorttitlepage{%
- \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}
+ {\headingsoff \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}\pageone}
\envdef\titlepage{%
% Open one extra group, as we want to close it in the middle of \Etitlepage.
\begingroup
\parindent=0pt \textfonts
+ \headingsoff
% Leave some space at the very top of the page.
\vglue\titlepagetopglue
% No rule at page bottom unless we print one at the top with @title.
@@ -3771,11 +3784,9 @@ $$%
% If we use the new definition of \page, we always get a blank page
% after the title page, which we certainly don't want.
\oldpage
+ \pageone
\endgroup
%
- % Need this before the \...aftertitlepage checks so that if they are
- % in effect the toc pages will come out with page numbers.
- \HEADINGSon
}
\def\finishtitlepage{%
@@ -3788,7 +3799,7 @@ $$%
% don't worry much about spacing, ragged right. This should be used
% inside a \vbox, and fonts need to be set appropriately first. \par should
% be specified before the end of the \vbox, since a vbox is a group.
-%
+%
\def\raggedtitlesettings{%
\rm
\hyphenpenalty=10000
@@ -3944,35 +3955,24 @@ $$%
}
\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
-\HEADINGSoff % it's the default
-% When we turn headings on, set the page number to 1.
+% Set the page number to 1.
\def\pageone{
\global\pageno=1
\global\arabiccount = \pagecount
}
+\let\contentsalignmacro = \chappager
+
+% \def\HEADINGSon{\HEADINGSdouble} % defined by \CHAPPAGon
+
% For double-sided printing, put current file name in lower left corner,
% chapter name on inside top of right hand pages, document
% title on inside top of left hand pages, and page numbers on outside top
% edge of all pages.
-\def\HEADINGSdouble{%
-\pageone
-\HEADINGSdoublex
-}
-\let\contentsalignmacro = \chappager
-
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingle{%
-\pageone
-\HEADINGSsinglex
-}
-\def\HEADINGSon{\HEADINGSdouble}
-
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdouble}
\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdoublex{%
+\def\HEADINGSdouble{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
@@ -3982,8 +3982,10 @@ $$%
\global\let\contentsalignmacro = \chapoddpage
}
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
-\def\HEADINGSsinglex{%
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsingle}
+\def\HEADINGSsingle{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
@@ -3995,7 +3997,6 @@ $$%
% for @setchapternewpage off
\def\HEADINGSsinglechapoff{%
-\pageone
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
@@ -4624,7 +4625,7 @@ $$%
% Like \expandablevalue, but completely expandable (the \message in the
% definition above operates at the execution level of TeX). Used when
% writing to auxiliary files, due to the expansion that \write does.
-% If flag is undefined, pass through an unexpanded @value command: maybe it
+% If flag is undefined, pass through an unexpanded @value command: maybe it
% will be set by the time it is read back in.
%
% NB flag names containing - or _ may not work here.
@@ -4648,7 +4649,7 @@ $$%
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
-%
+%
% To get the special treatment we need for `@end ifset,' we call
% \makecond and then redefine.
%
@@ -4681,7 +4682,7 @@ $$%
% without the @) is in fact defined. We can only feasibly check at the
% TeX level, so something like `mathcode' is going to considered
% defined even though it is not a Texinfo command.
-%
+%
\makecond{ifcommanddefined}
\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
%
@@ -4721,13 +4722,11 @@ $$%
% except not \outer, so it can be used within macros and \if's.
\edef\newwrite{\makecsname{ptexnewwrite}}
-% \newindex {foo} defines an index named IX.
+% \newindex {IX} defines an index named IX.
% It automatically defines \IXindex such that
% \IXindex ...rest of line... puts an entry in the index IX.
% It also defines \IXindfile to be the number of the output channel for
% the file that accumulates this index. The file's extension is IX.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
%
\def\newindex#1{%
\expandafter\chardef\csname#1indfile\endcsname=0
@@ -4789,22 +4788,7 @@ $$%
\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
\def\docodeindexxxx #1{\docind{\indexname}{#1}}
-
-% Used for the aux, toc and index files to prevent expansion of Texinfo
-% commands.
-%
-\def\atdummies{%
- \definedummyletter\@%
- \definedummyletter\ %
- \definedummyletter\{%
- \definedummyletter\}%
- \definedummyletter\&%
- %
- % Do the redefinitions.
- \definedummies
- \otherbackslash
-}
-
+
% \definedummyword defines \#1 as \string\#1\space, thus effectively
% preventing its expansion. This is used only for control words,
% not control letters, because the \space would be incorrect for
@@ -4820,110 +4804,91 @@ $$%
%
\def\definedummyword #1{\def#1{\string#1\space}}%
\def\definedummyletter#1{\def#1{\string#1}}%
-\let\definedummyaccent\definedummyletter
-% Called from \atdummies to prevent the expansion of commands.
+% Used for the aux, toc and index files to prevent expansion of Texinfo
+% commands. Most of the commands are controlled through the
+% \ifdummies conditional.
%
-\def\definedummies{%
+\def\atdummies{%
+ \dummiestrue
%
- \let\commondummyword\definedummyword
- \let\commondummyletter\definedummyletter
- \let\commondummyaccent\definedummyaccent
- \commondummiesnofonts
+ \definedummyletter\@%
+ \definedummyletter\ %
+ \definedummyletter\{%
+ \definedummyletter\}%
+ \definedummyletter\&%
%
\definedummyletter\_%
\definedummyletter\-%
%
- % Non-English letters.
- \definedummyword\AA
- \definedummyword\AE
- \definedummyword\DH
- \definedummyword\L
- \definedummyword\O
- \definedummyword\OE
- \definedummyword\TH
- \definedummyword\aa
- \definedummyword\ae
- \definedummyword\dh
- \definedummyword\exclamdown
- \definedummyword\l
- \definedummyword\o
- \definedummyword\oe
- \definedummyword\ordf
- \definedummyword\ordm
- \definedummyword\questiondown
- \definedummyword\ss
- \definedummyword\th
- %
- % Although these internal commands shouldn't show up, sometimes they do.
- \definedummyword\bf
- \definedummyword\gtr
- \definedummyword\hat
- \definedummyword\less
- \definedummyword\sf
- \definedummyword\sl
- \definedummyword\tclose
- \definedummyword\tt
- %
- \definedummyword\LaTeX
- \definedummyword\TeX
- %
- % Assorted special characters.
- \definedummyword\ampchar
- \definedummyword\atchar
- \definedummyword\arrow
- \definedummyword\backslashchar
- \definedummyword\bullet
- \definedummyword\comma
- \definedummyword\copyright
- \definedummyword\registeredsymbol
- \definedummyword\dots
- \definedummyword\enddots
- \definedummyword\entrybreak
- \definedummyword\equiv
- \definedummyword\error
- \definedummyword\euro
- \definedummyword\expansion
- \definedummyword\geq
- \definedummyword\guillemetleft
- \definedummyword\guillemetright
- \definedummyword\guilsinglleft
- \definedummyword\guilsinglright
- \definedummyword\lbracechar
- \definedummyword\leq
- \definedummyword\mathopsup
- \definedummyword\minus
- \definedummyword\ogonek
- \definedummyword\pounds
- \definedummyword\point
- \definedummyword\print
- \definedummyword\quotedblbase
- \definedummyword\quotedblleft
- \definedummyword\quotedblright
- \definedummyword\quoteleft
- \definedummyword\quoteright
- \definedummyword\quotesinglbase
- \definedummyword\rbracechar
- \definedummyword\result
- \definedummyword\sub
- \definedummyword\sup
- \definedummyword\textdegree
- %
\definedummyword\subentry
%
% We want to disable all macros so that they are not expanded by \write.
+ \let\commondummyword\definedummyword
\macrolist
\let\value\dummyvalue
%
- \normalturnoffactive
-}
-
-% \commondummiesnofonts: common to \definedummies and \indexnofonts.
-% Define \commondummyletter, \commondummyaccent and \commondummyword before
-% using. Used for accents, font commands, and various control letters.
-%
-\def\commondummiesnofonts{%
- % Control letters and accents.
+ \turnoffactive
+}
+
+\newif\ifdummies
+\newif\ifindexnofonts
+
+\def\commondummyletter#1{%
+ \expandafter\let\csname\string#1:impl\endcsname#1%
+ \edef#1{%
+ \noexpand\ifindexnofonts
+ % empty expansion
+ \noexpand\else
+ \noexpand\ifdummies\string#1%
+ \noexpand\else
+ \noexpand\jumptwofi % dispose of the \fi
+ \expandafter\noexpand\csname\string#1:impl\endcsname
+ \noexpand\fi
+ \noexpand\fi}%
+}
+
+\def\commondummyaccent#1{%
+ \expandafter\let\csname\string#1:impl\endcsname#1%
+ \edef#1{%
+ \noexpand\ifindexnofonts
+ \noexpand\expandafter % dispose of \else ... \fi
+ \noexpand\asis
+ \noexpand\else
+ \noexpand\ifdummies\string#1%
+ \noexpand\else
+ \noexpand\jumptwofi % dispose of the \fi
+ \expandafter\noexpand\csname\string#1:impl\endcsname
+ \noexpand\fi
+ \noexpand\fi}%
+}
+
+% Like \commondummyaccent but add a \space at the end of the dummy expansion
+% #2 is the expansion used for \indexnofonts. #2 is always followed by
+% \asis to remove a pair of following braces.
+\def\commondummyword#1#2{%
+ \expandafter\let\csname\string#1:impl\endcsname#1%
+ \expandafter\def\csname\string#1:ixnf\endcsname{#2\asis}%
+ \edef#1{%
+ \noexpand\ifindexnofonts
+ \noexpand\expandafter % dispose of \else ... \fi
+ \expandafter\noexpand\csname\string#1:ixnf\endcsname
+ \noexpand\else
+ \noexpand\ifdummies\string#1\space
+ \noexpand\else
+ \noexpand\jumptwofi % dispose of the \fi \fi
+ \expandafter\noexpand\csname\string#1:impl\endcsname
+ \noexpand\fi
+ \noexpand\fi}%
+}
+\def\jumptwofi#1\fi\fi{\fi\fi#1}
+
+% For \atdummies and \indexnofonts. \atdummies sets
+% \dummiestrue and \indexnofonts sets \indexnofontstrue.
+\def\definedummies{
+ % @-sign is always an escape character when reading auxiliary files
+ \escapechar = `\@
+ %
\commondummyletter\!%
\commondummyaccent\"%
\commondummyaccent\'%
@@ -4937,58 +4902,123 @@ $$%
\commondummyaccent\^%
\commondummyaccent\`%
\commondummyaccent\~%
- \commondummyword\u
- \commondummyword\v
- \commondummyword\H
- \commondummyword\dotaccent
- \commondummyword\ogonek
- \commondummyword\ringaccent
- \commondummyword\tieaccent
- \commondummyword\ubaraccent
- \commondummyword\udotaccent
- \commondummyword\dotless
+ %
+ % Control letters and accents.
+ \commondummyword\u {}%
+ \commondummyword\v {}%
+ \commondummyword\H {}%
+ \commondummyword\dotaccent {}%
+ \commondummyword\ogonek {}%
+ \commondummyword\ringaccent {}%
+ \commondummyword\tieaccent {}%
+ \commondummyword\ubaraccent {}%
+ \commondummyword\udotaccent {}%
+ \commondummyword\dotless {}%
%
% Texinfo font commands.
- \commondummyword\b
- \commondummyword\i
- \commondummyword\r
- \commondummyword\sansserif
- \commondummyword\sc
- \commondummyword\slanted
- \commondummyword\t
+ \commondummyword\b {}%
+ \commondummyword\i {}%
+ \commondummyword\r {}%
+ \commondummyword\sansserif {}%
+ \commondummyword\sc {}%
+ \commondummyword\slanted {}%
+ \commondummyword\t {}%
%
% Commands that take arguments.
- \commondummyword\abbr
- \commondummyword\acronym
- \commondummyword\anchor
- \commondummyword\cite
- \commondummyword\code
- \commondummyword\command
- \commondummyword\dfn
- \commondummyword\dmn
- \commondummyword\email
- \commondummyword\emph
- \commondummyword\env
- \commondummyword\file
- \commondummyword\image
- \commondummyword\indicateurl
- \commondummyword\inforef
- \commondummyword\kbd
- \commondummyword\key
- \commondummyword\math
- \commondummyword\option
- \commondummyword\pxref
- \commondummyword\ref
- \commondummyword\samp
- \commondummyword\strong
- \commondummyword\tie
- \commondummyword\U
- \commondummyword\uref
- \commondummyword\url
- \commondummyword\var
- \commondummyword\verb
- \commondummyword\w
- \commondummyword\xref
+ \commondummyword\abbr {}%
+ \commondummyword\acronym {}%
+ \commondummyword\anchor {}%
+ \commondummyword\cite {}%
+ \commondummyword\code {}%
+ \commondummyword\command {}%
+ \commondummyword\dfn {}%
+ \commondummyword\dmn {}%
+ \commondummyword\email {}%
+ \commondummyword\emph {}%
+ \commondummyword\env {}%
+ \commondummyword\file {}%
+ \commondummyword\image {}%
+ \commondummyword\indicateurl{}%
+ \commondummyword\inforef {}%
+ \commondummyword\kbd {}%
+ \commondummyword\key {}%
+ \commondummyword\math {}%
+ \commondummyword\option {}%
+ \commondummyword\pxref {}%
+ \commondummyword\ref {}%
+ \commondummyword\samp {}%
+ \commondummyword\strong {}%
+ \commondummyword\tie {}%
+ \commondummyword\U {}%
+ \commondummyword\uref {}%
+ \commondummyword\url {}%
+ \commondummyword\var {}%
+ \commondummyword\verb {}%
+ \commondummyword\w {}%
+ \commondummyword\xref {}%
+ %
+ \commondummyword\AA {AA}%
+ \commondummyword\AE {AE}%
+ \commondummyword\DH {DZZ}%
+ \commondummyword\L {L}%
+ \commondummyword\O {O}%
+ \commondummyword\OE {OE}%
+ \commondummyword\TH {TH}%
+ \commondummyword\aa {aa}%
+ \commondummyword\ae {ae}%
+ \commondummyword\dh {dzz}%
+ \commondummyword\exclamdown {!}%
+ \commondummyword\l {l}%
+ \commondummyword\o {o}%
+ \commondummyword\oe {oe}%
+ \commondummyword\ordf {a}%
+ \commondummyword\ordm {o}%
+ \commondummyword\questiondown {?}%
+ \commondummyword\ss {ss}%
+ \commondummyword\th {th}%
+ %
+ \commondummyword\LaTeX {LaTeX}%
+ \commondummyword\TeX {TeX}%
+ %
+ % Assorted special characters.
+ \commondummyword\ampchar {\normalamp}%
+ \commondummyword\atchar {\@}%
+ \commondummyword\arrow {->}%
+ \commondummyword\backslashchar {\realbackslash}%
+ \commondummyword\bullet {bullet}%
+ \commondummyword\comma {,}%
+ \commondummyword\copyright {copyright}%
+ \commondummyword\dots {...}%
+ \commondummyword\enddots {...}%
+ \commondummyword\entrybreak {}%
+ \commondummyword\equiv {===}%
+ \commondummyword\error {error}%
+ \commondummyword\euro {euro}%
+ \commondummyword\expansion {==>}%
+ \commondummyword\geq {>=}%
+ \commondummyword\guillemetleft {<<}%
+ \commondummyword\guillemetright {>>}%
+ \commondummyword\guilsinglleft {<}%
+ \commondummyword\guilsinglright {>}%
+ \commondummyword\lbracechar {\{}%
+ \commondummyword\leq {<=}%
+ \commondummyword\mathopsup {sup}%
+ \commondummyword\minus {-}%
+ \commondummyword\pounds {pounds}%
+ \commondummyword\point {.}%
+ \commondummyword\print {-|}%
+ \commondummyword\quotedblbase {"}%
+ \commondummyword\quotedblleft {"}%
+ \commondummyword\quotedblright {"}%
+ \commondummyword\quoteleft {`}%
+ \commondummyword\quoteright {'}%
+ \commondummyword\quotesinglbase {,}%
+ \commondummyword\rbracechar {\}}%
+ \commondummyword\registeredsymbol {R}%
+ \commondummyword\result {=>}%
+ \commondummyword\sub {}%
+ \commondummyword\sup {}%
+ \commondummyword\textdegree {o}%
}
\let\indexlbrace\relax
@@ -5039,18 +5069,7 @@ $$%
% would be for a given command (usually its argument).
%
\def\indexnofonts{%
- % Accent commands should become @asis.
- \def\commondummyaccent##1{\let##1\asis}%
- % We can just ignore other control letters.
- \def\commondummyletter##1{\let##1\empty}%
- % All control words become @asis by default; overrides below.
- \let\commondummyword\commondummyaccent
- \commondummiesnofonts
- %
- % Don't no-op \tt, since it isn't a user-level command
- % and is used in the definitions of the active chars like <, >, |, etc.
- % Likewise with the other plain tex font commands.
- %\let\tt=\asis
+ \indexnofontstrue
%
\def\ { }%
\def\@{@}%
@@ -5062,85 +5081,20 @@ $$%
\let\lbracechar\{%
\let\rbracechar\}%
%
- % Non-English letters.
- \def\AA{AA}%
- \def\AE{AE}%
- \def\DH{DZZ}%
- \def\L{L}%
- \def\OE{OE}%
- \def\O{O}%
- \def\TH{TH}%
- \def\aa{aa}%
- \def\ae{ae}%
- \def\dh{dzz}%
- \def\exclamdown{!}%
- \def\l{l}%
- \def\oe{oe}%
- \def\ordf{a}%
- \def\ordm{o}%
- \def\o{o}%
- \def\questiondown{?}%
- \def\ss{ss}%
- \def\th{th}%
- %
- \let\do\indexnofontsdef
- %
- \do\LaTeX{LaTeX}%
- \do\TeX{TeX}%
- %
- % Assorted special characters.
- \do\atchar{@}%
- \do\arrow{->}%
- \do\bullet{bullet}%
- \do\comma{,}%
- \do\copyright{copyright}%
- \do\dots{...}%
- \do\enddots{...}%
- \do\equiv{==}%
- \do\error{error}%
- \do\euro{euro}%
- \do\expansion{==>}%
- \do\geq{>=}%
- \do\guillemetleft{<<}%
- \do\guillemetright{>>}%
- \do\guilsinglleft{<}%
- \do\guilsinglright{>}%
- \do\leq{<=}%
- \do\lbracechar{\{}%
- \do\minus{-}%
- \do\point{.}%
- \do\pounds{pounds}%
- \do\print{-|}%
- \do\quotedblbase{"}%
- \do\quotedblleft{"}%
- \do\quotedblright{"}%
- \do\quoteleft{`}%
- \do\quoteright{'}%
- \do\quotesinglbase{,}%
- \do\rbracechar{\}}%
- \do\registeredsymbol{R}%
- \do\result{=>}%
- \do\textdegree{o}%
%
% We need to get rid of all macros, leaving only the arguments (if present).
% Of course this is not nearly correct, but it is the best we can do for now.
- % makeinfo does not expand macros in the argument to @deffn, which ends up
- % writing an index entry, and texindex isn't prepared for an index sort entry
- % that starts with \.
%
% Since macro invocations are followed by braces, we can just redefine them
% to take a single TeX argument. The case of a macro invocation that
% goes to end-of-line is not handled.
%
+ \def\commondummyword##1{\let##1\asis}%
\macrolist
\let\value\indexnofontsvalue
}
-% Give the control sequence a definition that removes the {} that follows
-% its use, e.g. @AA{} -> AA
-\def\indexnofontsdef#1#2{\def#1##1{#2}}%
-
-
+
% #1 is the index name, #2 is the entry text.
@@ -5181,7 +5135,7 @@ $$%
\ifx\suffix\indexisfl\def\suffix{f1}\fi
% Open the file
\immediate\openout\csname#1indfile\endcsname \jobname.\suffix
- % Using \immediate above here prevents an object entering into the current
+ % Using \immediate above here prevents an object entering into the current
% box, which could confound checks such as those in \safewhatsit for
% preceding skips.
\typeout{Writing index file \jobname.\suffix}%
@@ -5233,7 +5187,7 @@ $$%
\ifx\segment\isfinish
\else
%
- % Fully expand the segment, throwing away any @sortas directives, and
+ % Fully expand the segment, throwing away any @sortas directives, and
% trim spaces.
\edef\trimmed{\segment}%
\edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
@@ -5270,7 +5224,10 @@ $$%
\xdef\trimmed{\segment}%
\xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
\xdef\indexsortkey{\trimmed}%
- \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
+ \ifx\indexsortkey\empty
+ \message{Empty index sort key near line \the\inputlineno}%
+ \xdef\indexsortkey{ }%
+ \fi
}\fi
%
% Append to \fullindexsortkey.
@@ -5294,12 +5251,12 @@ $$%
% the current value of \escapechar.
\def\escapeisbackslash{\escapechar=`\\}
-% Use \ in index files by default. texi2dvi didn't support @ as the escape
-% character (as it checked for "\entry" in the files, and not "@entry"). When
-% the new version of texi2dvi has had a chance to become more prevalent, then
-% the escape character can change back to @ again. This should be an easy
-% change to make now because both @ and \ are only used as escape characters in
-% index files, never standing for themselves.
+% Use \ in index files by default. texi2dvi didn't support @ as the escape
+% character (as it checked for "\entry" in the files, and not "@entry"). When
+% the new version of texi2dvi has had a chance to become more prevalent, then
+% the escape character can change back to @ again. This should be an easy
+% change to make now because both @ and \ are only used as escape characters in
+% index files, never standing for themselves.
%
\set txiindexescapeisbackslash
@@ -5322,7 +5279,7 @@ $$%
\def\}{\rbracechar{}}%
\uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
%
- % Split the entry into primary entry and any subentries, and get the index
+ % Split the entry into primary entry and any subentries, and get the index
% sort key.
\splitindexentry\indextext
%
@@ -5503,18 +5460,18 @@ $$%
\uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
\ifflagclear{txiskipindexfileswithbackslash}{%
\errmessage{%
-ERROR: A sorted index file in an obsolete format was skipped.
+ERROR: A sorted index file in an obsolete format was skipped.
To fix this problem, please upgrade your version of 'texi2dvi'
or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
-If you are using an old version of 'texindex' (part of the Texinfo
+If you are using an old version of 'texindex' (part of the Texinfo
distribution), you may also need to upgrade to a newer version (at least 6.0).
You may be able to typeset the index if you run
'texindex \jobname.\indexname' yourself.
-You could also try setting the 'txiindexescapeisbackslash' flag by
+You could also try setting the 'txiindexescapeisbackslash' flag by
running a command like
-'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
+'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
this, Texinfo will try to use index files in the old format.
-If you continue to have problems, deleting the index files and starting again
+If you continue to have problems, deleting the index files and starting again
might help (with 'rm \jobname.?? \jobname.??s')%
}%
}{%
@@ -5587,7 +5544,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% bottom of a column to reduce an increase in inter-line spacing.
\nobreak
\vskip 0pt plus 5\baselineskip
- \penalty -300
+ \penalty -300
\vskip 0pt plus -5\baselineskip
%
% Typeset the initial. Making this add up to a whole number of
@@ -5610,6 +5567,11 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\newdimen\entryrightmargin
\entryrightmargin=0pt
+% for PDF output, whether to make the text of the entry a link to the page
+% number. set for @contents and @shortcontents where there is only one
+% page number.
+\newif\iflinkentrytext
+
% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
% then page number (#2) flushed to the right margin. It is used for index
% and table of contents entries. The paragraph is indented by \leftskip.
@@ -5636,7 +5598,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
}
\def\entrybreak{\unskip\space\ignorespaces}%
\def\doentry{%
- % Save the text of the entry
+ % Save the text of the entry in \boxA
\global\setbox\boxA=\hbox\bgroup
\bgroup % Instead of the swallowed brace.
\noindent
@@ -5646,12 +5608,21 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% with catcodes occurring.
}
{\catcode`\@=11
+% #1 is the page number
\gdef\finishentry#1{%
- \egroup % end box A
+ \egroup % end \boxA
\dimen@ = \wd\boxA % Length of text of entry
+ % add any leaders and page number to \boxA.
\global\setbox\boxA=\hbox\bgroup
- \unhbox\boxA
- % #1 is the page number.
+ \ifpdforxetex
+ \iflinkentrytext
+ \pdflinkpage{#1}{\unhbox\boxA}%
+ \else
+ \unhbox\boxA
+ \fi
+ \else
+ \unhbox\boxA
+ \fi
%
% Get the width of the page numbers, and only use
% leaders if they are present.
@@ -5670,6 +5641,8 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi
\fi
\egroup % end \boxA
+ %
+ % now output
\ifdim\wd\boxB = 0pt
\noindent\unhbox\boxA\par
\nobreak
@@ -5703,7 +5676,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\advance\dimen@ii by 1\dimen@i
\ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
\ifdim\dimen@ > 0.8\dimen@ii % due to long index text
- % Try to split the text roughly evenly. \dimen@ will be the length of
+ % Try to split the text roughly evenly. \dimen@ will be the length of
% the first line.
\dimen@ = 0.7\dimen@
\dimen@ii = \hsize
@@ -5911,7 +5884,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\newbox\balancedcolumns
\setbox\balancedcolumns=\vbox{shouldnt see this}%
%
-% Only called for the last of the double column material. \doublecolumnout
+% Only called for the last of the double column material. \doublecolumnout
% does the others.
\def\balancecolumns{%
\setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
@@ -5939,7 +5912,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
}%
% Now the left column is in box 1, and the right column in box 3.
%
- % Check whether the left column has come out higher than the page itself.
+ % Check whether the left column has come out higher than the page itself.
% (Note that we have doubled \vsize for the double columns, so
% the actual height of the page is 0.5\vsize).
\ifdim2\ht1>\vsize
@@ -6236,7 +6209,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\let\top\unnumbered
% Sections.
-%
+%
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
\def\seczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
@@ -6259,7 +6232,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
}
% Subsections.
-%
+%
% normally calls numberedsubseczzz:
\outer\parseargdef\numberedsubsec{\numhead2{#1}}
\def\numberedsubseczzz#1{%
@@ -6284,7 +6257,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
}
% Subsubsections.
-%
+%
% normally numberedsubsubseczzz:
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
\def\numberedsubsubseczzz#1{%
@@ -6369,7 +6342,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi
}
-\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
+\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname\HEADINGSon}
\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
@@ -6386,7 +6359,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\global\let\pchapsepmacro=\chapoddpage
\global\def\HEADINGSon{\HEADINGSdouble}}
-\CHAPPAGon
+\setchapternewpage on
% \chapmacro - Chapter opening.
%
@@ -6399,6 +6372,16 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\Yappendixkeyword{Yappendix}
\def\Yomitfromtockeyword{Yomitfromtoc}
%
+%
+% Definitions for @thischapter. These can be overridden in translation
+% files.
+\def\thischapterAppendix{%
+ \putwordAppendix{} \thischapternum: \thischaptername}
+
+\def\thischapterChapter{%
+ \putwordChapter{} \thischapternum: \thischaptername}
+%
+%
\def\chapmacro#1#2#3{%
\expandafter\ifx\thisenv\titlepage\else
\checkenv{}% chapters, etc., should not start inside an environment.
@@ -6421,22 +6404,14 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\appendixletter}%
- % \noexpand\putwordAppendix avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
- \noexpand\thischapternum:
- \noexpand\thischaptername}%
+ \let\noexpand\thischapter\noexpand\thischapterAppendix
}%
\else
\toks0={#1}%
\xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\the\chapno}%
- % \noexpand\putwordChapter avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
- \noexpand\thischapternum:
- \noexpand\thischaptername}%
+ \let\noexpand\thischapter\noexpand\thischapterChapter
}%
\fi\fi\fi
%
@@ -6522,6 +6497,12 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\subsubsecheadingskip{\subsecheadingskip}
\def\subsubsecheadingbreak{\subsecheadingbreak}
+% Definition for @thissection. This can be overridden in translation
+% files.
+\def\thissectionDef{%
+ \putwordSection{} \thissectionnum: \thissectionname}
+%
+
% Print any size, any type, section title.
%
@@ -6563,11 +6544,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
- % \noexpand\putwordSection avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thissection{\noexpand\putwordSection{}
- \noexpand\thissectionnum:
- \noexpand\thissectionname}%
+ \let\noexpand\thissection\noexpand\thissectionDef
}%
\fi
\else
@@ -6576,11 +6553,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
- % \noexpand\putwordSection avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thissection{\noexpand\putwordSection{}
- \noexpand\thissectionnum:
- \noexpand\thissectionname}%
+ \let\noexpand\thissection\noexpand\thissectionDef
}%
\fi
\fi\fi\fi
@@ -6766,6 +6739,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\thistitle{}% no title in double-sided headings
% Record where the Roman numerals started.
\ifnum\romancount=0 \global\romancount=\pagecount \fi
+ \linkentrytexttrue
}
% \raggedbottom in plain.tex hardcodes \topskip so override it
@@ -6893,7 +6867,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Chapters, in the short toc.
% See comments in \dochapentry re vbox and related settings.
\def\shortchapentry#1#2#3#4{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{#4}%
}
% Appendices, in the main contents.
@@ -6908,7 +6882,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Unnumbered chapters.
\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
-\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{#4}}
% Sections.
\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
@@ -6940,24 +6914,24 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Move the page numbers slightly to the right
\advance\entryrightmargin by -0.05em
\chapentryfonts
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \tocentry{#1}{#2}%
\endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip
}
\def\dosecentry#1#2{\begingroup
\secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \tocentry{#1}{#2}%
\endgroup}
\def\dosubsecentry#1#2{\begingroup
\subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \tocentry{#1}{#2}%
\endgroup}
\def\dosubsubsecentry#1#2{\begingroup
\subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \tocentry{#1}{#2}%
\endgroup}
% We use the same \entry macro as for the index entries.
@@ -6966,9 +6940,6 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Space between chapter (or whatever) number and the title.
\def\labelspace{\hskip1em \relax}
-\def\dopageno#1{{\rm #1}}
-\def\doshortpageno#1{{\rm #1}}
-
\def\chapentryfonts{\secfonts \rm}
\def\secentryfonts{\textfonts}
\def\subsecentryfonts{\textfonts}
@@ -7113,19 +7084,25 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\newdimen\cartouter\newdimen\cartinner
\newskip\normbskip\newskip\normpskip\newskip\normlskip
-
-\envdef\cartouche{%
+\envparseargdef\cartouche{%
\cartouchefontdefs
\ifhmode\par\fi % can't be in the midst of a paragraph.
\startsavinginserts
\lskip=\leftskip \rskip=\rightskip
\leftskip=0pt\rightskip=0pt % we want these *outside*.
+ %
+ % Set paragraph width for text inside cartouche. There are
+ % left and right margins of 3pt each plus two vrules 0.4pt each.
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
+ \advance\cartinner by -6.8pt
+ %
+ % For drawing top and bottom of cartouche. Each corner char
+ % adds 6pt and we take off the width of a rule to line up with the
+ % right boundary perfectly.
\cartouter=\hsize
- \advance\cartouter by 18.4pt % allow for 3pt kerns on either
- % side, and for 6pt waste from
- % each corner char, and rule thickness
+ \advance\cartouter by 11.6pt
+ %
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
%
% If this cartouche directly follows a sectioning command, we need the
@@ -7137,16 +7114,19 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\baselineskip=0pt\parskip=0pt\lineskip=0pt
\carttop
\hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \kern3pt
- \hsize=\cartinner
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \vskip -\parskip
- \comment % For explanation, see the end of def\group.
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \def\arg{#1}%
+ \ifx\arg\empty\else
+ \centerV{\hfil \bf #1 \hfil}%
+ \fi
+ \kern3pt
+ \vskip -\parskip
}
\def\Ecartouche{%
\ifhmode\par\fi
@@ -7339,7 +7319,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% @indentedblock is like @quotation, but indents only on the left and
% has no optional argument.
-%
+%
\makedispenvdef{indentedblock}{\indentedblockstart}
%
\def\indentedblockstart{%
@@ -7397,8 +7377,9 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\endgroup
%
\def\setupverb{%
- \tt % easiest (and conventionally used) font for verbatim
+ \tt
\def\par{\leavevmode\endgraf}%
+ \parindent = 0pt
\setcodequotes
\tabeightspaces
% Respect line breaks,
@@ -7574,32 +7555,19 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\exdentamount=\defbodyindent
}
-\def\dodefunx#1{%
- % First, check whether we are in the right environment:
- \checkenv#1%
- %
- % As above, allow line break if we have multiple x headers in a row.
- % It's not a great place, though.
- \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
- %
- % And now, it's time to reuse the body of the original defun:
- \expandafter\gobbledefun#1%
-}
-\def\gobbledefun#1\startdefun{}
-
-% \printdefunline \deffnheader{text}
+% Called as \printdefunline \deffooheader{text}
%
\def\printdefunline#1#2{%
\begingroup
\plainfrenchspacing
- % call \deffnheader:
+ % call \deffooheader:
#1#2 \endheader
% common ending:
\interlinepenalty = 10000
\advance\rightskip by 0pt plus 1fil\relax
\endgraf
\nobreak\vskip -\parskip
- \penalty\defunpenalty % signal to \startdefun and \dodefunx
+ \penalty\defunpenalty % signal to \startdefun and \deffoox
% Some of the @defun-type tags do not enable magic parentheses,
% rendering the following check redundant. But we don't optimize.
\checkparencounts
@@ -7608,7 +7576,25 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\Edefun{\endgraf\medbreak}
-% \makedefun{deffoo}{ (definition of \deffooheader) }
+% @defblock, @defline do not automatically create index entries
+\envdef\defblock{%
+ \startdefun
+}
+\let\Edefblock\Edefun
+
+\def\defline{%
+ \doingtypefnfalse
+ \parseargusing\activeparens{\printdefunline\deflineheader}%
+}
+\def\deflineheader#1 #2 #3\endheader{%
+ \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
+}
+\def\deftypeline{%
+ \doingtypefntrue
+ \parseargusing\activeparens{\printdefunline\deflineheader}%
+}
+
+% \makedefun{deffoo} (\deffooheader parameters) { (\deffooheader expansion) }
%
% Define \deffoo, \deffoox \Edeffoo and \deffooheader.
\def\makedefun#1{%
@@ -7623,8 +7609,18 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\doingtypefnfalse % distinguish typed functions from all else
\parseargusing\activeparens{\printdefunline#3}%
}%
- \def#2{\dodefunx#1}%
- \def#3%
+ \def#2{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
+ %
+ % As in \startdefun, allow line break if we have multiple x headers
+ % in a row. It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
+ %
+ \doingtypefnfalse % distinguish typed functions from all else
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#3% definition of \deffooheader follows
}
\newif\ifdoingtypefn % doing typed function?
@@ -7633,7 +7629,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% @deftypefnnewline on|off says whether the return type of typed functions
% are printed on their own line. This affects @deftypefn, @deftypefun,
% @deftypeop, and @deftypemethod.
-%
+%
\parseargdef\deftypefnnewline{%
\def\temp{#1}%
\ifx\temp\onword
@@ -7654,14 +7650,14 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% @deffn category name args
\makedefun{deffn}#1 #2 #3\endheader{%
\doind{fn}{\code{#2}}%
- \defname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
+ \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
}
% @defop category class name args
\makedefun{defop}#1 {\defopheaderx{#1\ \putwordon}}
\def\defopheaderx#1#2 #3 #4\endheader{%
\doind{fn}{\code{#3}\space\putwordon\ \code{#2}}%
- \defname{#1\ \code{#2}}{}{#3}\magicamp\defunargs{#4\unskip}%
+ \printdefname{#1\ \code{#2}}{}{#3}\magicamp\defunargs{#4\unskip}%
}
% Typed functions:
@@ -7670,7 +7666,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\makedefun{deftypefn}#1 #2 #3 #4\endheader{%
\doind{fn}{\code{#3}}%
\doingtypefntrue
- \defname{#1}{#2}{#3}\defunargs{#4\unskip}%
+ \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
}
% @deftypeop category class type name args
@@ -7678,7 +7674,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\deftypeopheaderx#1#2 #3 #4 #5\endheader{%
\doind{fn}{\code{#4}\space\putwordon\ \code{#1\ \code{#2}}}%
\doingtypefntrue
- \defname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
+ \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
}
% Typed variables:
@@ -7686,14 +7682,14 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% @deftypevr category type var args
\makedefun{deftypevr}#1 #2 #3 #4\endheader{%
\doind{vr}{\code{#3}}%
- \defname{#1}{#2}{#3}\defunargs{#4\unskip}%
+ \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
}
% @deftypecv category class type var args
\makedefun{deftypecv}#1 {\deftypecvheaderx{#1\ \putwordof}}
\def\deftypecvheaderx#1#2 #3 #4 #5\endheader{%
\doind{vr}{\code{#4}\space\putwordof\ \code{#2}}%
- \defname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
+ \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
}
% Untyped variables:
@@ -7710,7 +7706,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% @deftp category name args
\makedefun{deftp}#1 #2 #3\endheader{%
\doind{tp}{\code{#2}}%
- \defname{#1}{}{#2}\defunargs{#3\unskip}%
+ \printdefname{#1}{}{#2}\defunargs{#3\unskip}%
}
% Remaining @defun-like shortcuts:
@@ -7726,14 +7722,14 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\makedefun{defivar}{\defcvheaderx\putwordInstanceVariableof}
\makedefun{deftypeivar}{\deftypecvheaderx\putwordInstanceVariableof}
-% \defname, which formats the name of the @def (not the args).
+% \printdefname, which formats the name of the @def (not the args).
% #1 is the category, such as "Function".
% #2 is the return type, if any.
% #3 is the function name.
%
% We are followed by (but not passed) the arguments, if any.
%
-\def\defname#1#2#3{%
+\def\printdefname#1#2#3{%
\par
% Get the values of \leftskip and \rightskip as they were outside the @def...
\advance\leftskip by -\defbodyindent
@@ -7801,7 +7797,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\tclose{\temp}% typeset the return type
\ifrettypeownline
% put return type on its own line; prohibit line break following:
- \hfil\vadjust{\nobreak}\break
+ \hfil\vadjust{\nobreak}\break
\else
\space % type on same line, so just followed by a space
\fi
@@ -7818,10 +7814,12 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Print arguments. Use slanted for @def*, typewriter for @deftype*.
\def\defunargs#1{%
- \df \ifdoingtypefn \tt \else \sl \fi
- \ifflagclear{txicodevaristt}{}%
- {\def\var##1{{\setregularquotes \ttsl ##1}}}%
- #1%
+ \bgroup
+ \df \ifdoingtypefn \tt \else \sl \fi
+ \ifflagclear{txicodevaristt}{}%
+ {\def\var##1{{\setregularquotes \ttsl ##1}}}%
+ #1%
+ \egroup
}
% We want ()&[] to print specially on the defun line.
@@ -7856,7 +7854,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% If we encounter &foo, then turn on ()-hacking afterwards
\newif\ifampseen
-\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+\def\amprm#1 {\ampseentrue{\rm\&#1 }}
\def\parenfont{%
\ifampseen
@@ -7948,7 +7946,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\scantokens{#1@comment}%
%
% The \comment is to remove the \newlinechar added by \scantokens, and
- % can be noticed by \parsearg. Note \c isn't used because this means cedilla
+ % can be noticed by \parsearg. Note \c isn't used because this means cedilla
% in math mode.
}
@@ -8143,7 +8141,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% list to some hook where the argument is to be expanded. If there are
% less than 10 arguments that hook is to be replaced by ##N where N
% is the position in that list, that is to say the macro arguments are to be
-% defined `a la TeX in the macro body.
+% defined `a la TeX in the macro body.
%
% That gets used by \mbodybackslash (above).
%
@@ -8177,15 +8175,15 @@ might help (with 'rm \jobname.?? \jobname.??s')%
%
% Read recursive and nonrecursive macro bodies. (They're different since
% rec and nonrec macros end differently.)
-%
-% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
+%
+% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
% body to be transformed.
-% Set \macrobody to the body of the macro, and call \defmacro.
+% Set \macrobody to the body of the macro, and call \macrodef.
%
{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
-\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
+\xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
-\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
+\xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
% Make @ a letter, so that we can make private-to-Texinfo macro names.
\edef\texiatcatcode{\the\catcode`\@}
@@ -8212,7 +8210,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% twice the \macarg.BLAH macros does not cost too much processing power.
\def\parsemmanyargdef@@#1,{%
\if#1;\let\next=\relax
- \else
+ \else
\let\next=\parsemmanyargdef@@
\edef\tempb{\eatspaces{#1}}%
\expandafter\def\expandafter\tempa
@@ -8297,7 +8295,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Replace arguments by their values in the macro body, and place the result
% in macro \@tempa.
-%
+%
\def\macvalstoargs@{%
% To do this we use the property that token registers that are \the'ed
% within an \edef expand only once. So we are going to place all argument
@@ -8321,9 +8319,9 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
}
-% Define the named-macro outside of this group and then close this group.
-%
-\def\macargexpandinbody@{%
+% Define the named-macro outside of this group and then close this group.
+%
+\def\macargexpandinbody@{%
\expandafter
\endgroup
\macargdeflist@
@@ -8361,7 +8359,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
}
% Trailing missing arguments are set to empty.
-%
+%
\def\setemptyargvalues@{%
\ifx\paramlist\nilm@
\let\next\macargexpandinbody@
@@ -8404,46 +8402,47 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% \xdef is used so that macro definitions will survive the file
% they're defined in: @include reads the file inside a group.
%
-\def\defmacro{%
+\def\macrodef{%
\let\hash=##% convert placeholders to macro parameter chars
\ifnum\paramno=1
- \def\xeatspaces##1{##1}%
- % This removes the pair of braces around the argument. We don't
- % use \eatspaces, because this can cause ends of lines to be lost
- % when the argument to \eatspaces is read, leading to line-based
- % commands like "@itemize" not being read correctly.
+ \long\def\xeatspaces##1{##1}%
+ % We don't use \xeatspaces for single-argument macros, because we
+ % want to keep ends of lines. This definition removes \xeatspaces
+ % when \macrobody is expanded below.
\else
- \let\xeatspaces\relax % suppress expansion
+ \def\xeatspaces{\string\xeatspaces}%
+ % This expands \xeatspaces as a sequence of character tokens, which
+ % stops \scantokens inserting an extra space after the control sequence.
\fi
\ifcase\paramno
% 0
\expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
+ \begingroup
\noexpand\spaceisspace
\noexpand\endlineisspace
\noexpand\expandafter % skip any whitespace after the macro name.
\expandafter\noexpand\csname\the\macname @@@\endcsname}%
\expandafter\xdef\csname\the\macname @@@\endcsname{%
- \egroup
+ \endgroup
\noexpand\scanmacro{\macrobody}}%
\or % 1
\expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
+ \begingroup
\noexpand\braceorline
\expandafter\noexpand\csname\the\macname @@@\endcsname}%
\expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \egroup
+ \endgroup
\noexpand\scanmacro{\macrobody}%
}%
\else % at most 9
\ifnum\paramno<10\relax
% @MACNAME sets the context for reading the macro argument
- % @MACNAME@@ gets the argument, processes backslashes and appends a
+ % @MACNAME@@ gets the argument, processes backslashes and appends a
% comma.
% @MACNAME@@@ removes braces surrounding the argument list.
% @MACNAME@@@@ scans the macro body with arguments substituted.
\expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup
+ \begingroup
\noexpand\expandafter % This \expandafter skip any spaces after the
\noexpand\macroargctxt % macro before we change the catcode of space.
\noexpand\expandafter
@@ -8457,7 +8456,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\expandafter\xdef
\expandafter\expandafter
\csname\the\macname @@@@\endcsname\paramlist{%
- \egroup\noexpand\scanmacro{\macrobody}}%
+ \endgroup\noexpand\scanmacro{\macrobody}}%
\else % 10 or more:
\expandafter\xdef\csname\the\macname\endcsname{%
\noexpand\getargvals@{\the\macname}{\argl}%
@@ -8482,11 +8481,11 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Call #1 with a list of tokens #2, with any doubled backslashes in #2
% compressed to one.
%
-% This implementation works by expansion, and not execution (so we cannot use
-% \def or similar). This reduces the risk of this failing in contexts where
-% complete expansion is done with no execution (for example, in writing out to
+% This implementation works by expansion, and not execution (so we cannot use
+% \def or similar). This reduces the risk of this failing in contexts where
+% complete expansion is done with no execution (for example, in writing out to
% an auxiliary file for an index entry).
-%
+%
% State is kept in the input stream: the argument passed to
% @look_ahead, @gobble_and_check_finish and @add_segment is
%
@@ -8508,11 +8507,11 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% #3 - NEXT_TOKEN
% #4 used to look ahead
%
-% If the next token is not a backslash, process the rest of the argument;
+% If the next token is not a backslash, process the rest of the argument;
% otherwise, remove the next token.
@gdef@look_ahead#1!#2#3#4{%
@ifx#4\%
- @expandafter@gobble_and_check_finish
+ @expandafter@gobble_and_check_finish
@else
@expandafter@add_segment
@fi#1!{#2}#4#4%
@@ -8536,9 +8535,9 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% #3 - NEXT_TOKEN
% #4 is input stream until next backslash
%
-% Input stream is either at the start of the argument, or just after a
-% backslash sequence, either a lone backslash, or a doubled backslash.
-% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
+% Input stream is either at the start of the argument, or just after a
+% backslash sequence, either a lone backslash, or a doubled backslash.
+% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
% finish; otherwise, append to ARG_RESULT the segment of the argument up until
% the next backslash. PENDING_BACKSLASH contains a backslash to represent
% a backslash just before the start of the input stream that has not been
@@ -8550,13 +8549,13 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% append the pending backslash to the result, followed by the next segment
@expandafter@is_fi@look_ahead#1#2#4!{\}@fi
% this @fi is discarded by @look_ahead.
- % we can't get rid of it with \expandafter because we don't know how
+ % we can't get rid of it with \expandafter because we don't know how
% long #4 is.
}
% #1 - THE_MACRO
% #2 - ARG_RESULT
-% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
+% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
% conditional.
@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
@@ -8568,7 +8567,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% for reading the argument (slightly different in the two cases). Then,
% to read the argument, in the whole-line case, it then calls the regular
% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
-%
+%
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
\ifx\nchar\bgroup
@@ -8579,6 +8578,75 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi \macnamexxx}
+% @linemacro
+
+\parseargdef\linemacro{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty
+ \paramno=0
+ \let\hash\relax
+ \def\paramlist{\hash 1\endlinemacro}%
+ \else
+ \expandafter\linegetparamlist\argl;%
+ \fi
+ \begingroup \macrobodyctxt \usembodybackslash
+ \parselinemacrobody
+}
+
+% Build up \paramlist which will be used as the parameter text for the macro.
+% At the end it will be like "#1 #2 #3\endlinemacro".
+\def\linegetparamlist#1;{%
+ \paramno=0\def\paramlist{}%
+ \let\hash\relax
+ \linegetparamlistxxx#1,;,%
+}
+\def\linegetparamlistxxx#1,{%
+ \if#1;\let\next=\linegetparamlistxxxx
+ \else \let\next=\linegetparamlistxxx
+ \advance\paramno by 1
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\hash\the\paramno}%
+ \edef\paramlist{\paramlist\hash\the\paramno\space}%
+ \fi\next}
+\def\linegetparamlistxxxx{%
+ \expandafter\fixparamlist\paramlist\fixparamlist
+}
+% Replace final space token
+\def\fixparamlist#1 \fixparamlist{%
+ \def\paramlist{#1\endlinemacro}%
+}
+
+% Read the body of the macro, replacing backslash-surrounded variables
+%
+{\catcode`\ =\other\long\gdef\parselinemacrobody#1@end linemacro{%
+\xdef\macrobody{#1}%
+\endgroup
+\linemacrodef
+}}
+
+% Make the definition
+\def\linemacrodef{%
+ \let\hash=##%
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup
+ \noexpand\parsearg
+ \expandafter\noexpand\csname\the\macname @@\endcsname
+ }
+ \expandafter\xdef\csname\the\macname @@\endcsname##1{%
+ \egroup
+ \expandafter\noexpand
+ \csname\the\macname @@@\endcsname##1\noexpand\endlinemacro
+ }
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter\csname\the\macname @@@\endcsname\paramlist{%
+ \newlinechar=13 % split \macrobody into lines
+ \noexpand\scantokens{\macrobody}%
+ }
+}
+
+
+
% @alias.
% We need some trickery to remove the optional spaces around the equal
% sign. Make them active and then expand them all to nothing.
@@ -8622,7 +8690,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Used so that the @top node doesn't have to be wrapped in an @ifnottex
% conditional.
-% \doignore goes to more effort to skip nested conditionals but we don't need
+% \doignore goes to more effort to skip nested conditionals but we don't need
% that here.
\def\omittopnode{%
\ifx\lastnode\wordTop
@@ -8699,7 +8767,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% automatically in xrefs, if the third arg is not explicitly specified.
% This was provided as a "secret" @set xref-automatic-section-title
% variable, now it's official.
-%
+%
\parseargdef\xrefautomaticsectiontitle{%
\def\temp{#1}%
\ifx\temp\onword
@@ -8715,7 +8783,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi\fi
}
-%
+%
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed
% node name, #4 the name of the Info file, #5 the name of the printed
@@ -8868,24 +8936,24 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi
\else
% node/anchor (non-float) references.
- %
+ %
% If we use \unhbox to print the node names, TeX does not insert
% empty discretionaries after hyphens, which means that it will not
% find a line break at a hyphen in a node names. Since some manuals
% are best written with fairly long node names, containing hyphens,
% this is a loss. Therefore, we give the text of the node name
% again, so it is as if TeX is seeing it for the first time.
- %
+ %
\ifdim \wd\printedmanualbox > 0pt
% Cross-manual reference with a printed manual name.
- %
+ %
\crossmanualxref{\cite{\printedmanual\unskip}}%
%
\else\ifdim \wd\infofilenamebox > 0pt
% Cross-manual reference with only an info filename (arg 4), no
% printed manual name (arg 5). This is essentially the same as
% the case above; we output the filename, since we have nothing else.
- %
+ %
\crossmanualxref{\code{\infofilename\unskip}}%
%
\else
@@ -8900,11 +8968,10 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\xrefprintnodename\printedrefname
%
\ifflagclear{txiomitxrefpg}{%
- % But we always want a comma and a space:
- ,\space
- %
+ % We always want a comma
+ ,%
% output the `page 3'.
- \turnoffactive \putwordpage\tie\refx{#1-pg}%
+ \turnoffactive \putpageref{#1}%
% Add a , if xref followed by a space
\if\space\noexpand\tokenafterxref ,%
\else\ifx\ \tokenafterxref ,% @TAB
@@ -8920,21 +8987,25 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\endlink
\endgroup}
+% can be overridden in translation files
+\def\putpageref#1{%
+ \space\putwordpage\tie\refx{#1-pg}}
+
% Output a cross-manual xref to #1. Used just above (twice).
-%
+%
% Only include the text "Section ``foo'' in" if the foo is neither
% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
% "see The Foo Manual", the idea being to refer to the whole manual.
-%
+%
% But, this being TeX, we can't easily compare our node name against the
% string "Top" while ignoring the possible spaces before and after in
% the input. By adding the arbitrary 7sp below, we make it much less
% likely that a real node name would have the same width as "Top" (e.g.,
% in a monospaced font). Hopefully it will never happen in practice.
-%
+%
% For the same basic reason, we retypeset the "Top" at every
% reference, since the current font is indeterminate.
-%
+%
\def\crossmanualxref#1{%
\setbox\toprefbox = \hbox{Top\kern7sp}%
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
@@ -9011,9 +9082,9 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi
}
-% This is the macro invoked by entries in the aux file. Define a control
-% sequence for a cross-reference target (we prepend XR to the control sequence
-% name to avoid collisions). The value is the page number. If this is a float
+% This is the macro invoked by entries in the aux file. Define a control
+% sequence for a cross-reference target (we prepend XR to the control sequence
+% name to avoid collisions). The value is the page number. If this is a float
% type, we have more work to do.
%
\def\xrdef#1#2{%
@@ -9029,10 +9100,10 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\bgroup
\expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
\egroup
- % We put the \gdef inside a group to avoid the definitions building up on
- % TeX's save stack, which can cause it to run out of space for aux files with
+ % We put the \gdef inside a group to avoid the definitions building up on
+ % TeX's save stack, which can cause it to run out of space for aux files with
% thousands of lines. \gdef doesn't use the save stack, but \csname does
- % when it defines an unknown control sequence as \relax.
+ % when it defines an unknown control sequence as \relax.
%
% Was that xref control sequence that we just defined for a float?
\expandafter\iffloat\csname XR\safexrefname\endcsname
@@ -9567,8 +9638,8 @@ might help (with 'rm \jobname.?? \jobname.??s')%
%
\def\caption{\docaption\thiscaption}
\def\shortcaption{\docaption\thisshortcaption}
-\def\docaption{\checkenv\float \bgroup\scanctxt\defcaption}
-\def\defcaption#1#2{\egroup \def#1{#2}}
+\def\docaption{\checkenv\float \bgroup\scanctxt\docaptionz}
+\def\docaptionz#1#2{\egroup \def#1{#2}}
% The parameter is the control sequence identifying the counter we are
% going to use. Create it if it doesn't exist and assign it to \floatno.
@@ -9857,12 +9928,10 @@ directory should work if nowhere else does.}
% For native Unicode handling (XeTeX and LuaTeX)
\nativeunicodechardefs
\else
- % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
+ % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX).
+ % Since we already invoke \utfeightchardefs at the top level,
+ % making non-ascii chars active is sufficient.
\setnonasciicharscatcode\active
- % since we already invoked \utfeightchardefs at the top level
- % (below), do not re-invoke it, otherwise our check for duplicated
- % definitions gets triggered. Making non-ascii chars active is
- % sufficient.
\fi
%
\else
@@ -9887,7 +9956,6 @@ directory should work if nowhere else does.}
\fi
}
-% emacs-page
% A message to be logged when using a character that isn't available
% the default font encoding (OT1).
%
@@ -9896,12 +9964,6 @@ directory should work if nowhere else does.}
% Take account of \c (plain) vs. \, (Texinfo) difference.
\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
-% First, make active non-ASCII characters in order for them to be
-% correctly categorized when TeX reads the replacement text of
-% macros containing the character definitions.
-\setnonasciicharscatcode\active
-%
-
\def\gdefchar#1#2{%
\gdef#1{%
\ifpassthroughchars
@@ -9911,8 +9973,14 @@ directory should work if nowhere else does.}
\fi
}}
+\begingroup
+
+% Make non-ASCII characters active for defining the character definition
+% macros.
+\setnonasciicharscatcode\active
+
% Latin1 (ISO-8859-1) character definitions.
-\def\latonechardefs{%
+\gdef\latonechardefs{%
\gdefchar^^a0{\tie}
\gdefchar^^a1{\exclamdown}
\gdefchar^^a2{{\tcfont \char162}} % cent
@@ -10017,7 +10085,7 @@ directory should work if nowhere else does.}
}
% Latin9 (ISO-8859-15) encoding character definitions.
-\def\latninechardefs{%
+\gdef\latninechardefs{%
% Encoding is almost identical to Latin1.
\latonechardefs
%
@@ -10032,7 +10100,7 @@ directory should work if nowhere else does.}
}
% Latin2 (ISO-8859-2) character definitions.
-\def\lattwochardefs{%
+\gdef\lattwochardefs{%
\gdefchar^^a0{\tie}
\gdefchar^^a1{\ogonek{A}}
\gdefchar^^a2{\u{}}
@@ -10050,7 +10118,7 @@ directory should work if nowhere else does.}
\gdefchar^^ae{\v Z}
\gdefchar^^af{\dotaccent Z}
%
- \gdefchar^^b0{\textdegree{}}
+ \gdefchar^^b0{\textdegree}
\gdefchar^^b1{\ogonek{a}}
\gdefchar^^b2{\ogonek{ }}
\gdefchar^^b3{\l}
@@ -10136,6 +10204,8 @@ directory should work if nowhere else does.}
\gdefchar^^ff{\dotaccent{}}
}
+\endgroup % active chars
+
% UTF-8 character definitions.
%
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
@@ -10230,7 +10300,7 @@ directory should work if nowhere else does.}
\uppercase{.}
\endgroup
\else
- \errhelp = \EMsimple
+ \errhelp = \EMsimple
\errmessage{Unicode character U+#1 not supported, sorry}%
\fi
\else
@@ -10263,7 +10333,7 @@ directory should work if nowhere else does.}
\countUTFz = "#1\relax
\begingroup
\parseXMLCharref
-
+
% Give \u8:... its definition. The sequence of seven \expandafter's
% expands after the \gdef three times, e.g.
%
@@ -10275,7 +10345,7 @@ directory should work if nowhere else does.}
\expandafter\expandafter
\expandafter\expandafter
\expandafter\gdef \UTFviiiTmp{#2}%
- %
+ %
\expandafter\ifx\csname uni:#1\endcsname \relax \else
\message{Internal error, already defined: #1}%
\fi
@@ -10314,7 +10384,7 @@ directory should work if nowhere else does.}
\divide\countUTFz by 64
\countUTFy = \countUTFz % Save to be the future value of \countUTFz.
\multiply\countUTFz by 64
-
+
% \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
% in order to get the last five bits.
\advance\countUTFx by -\countUTFz
@@ -10349,7 +10419,7 @@ directory should work if nowhere else does.}
% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
-%
+%
% Many of our renditions are less than wonderful, and all the missing
% characters are available somewhere. Loading the necessary fonts
% awaits user request. We can't truly support Unicode without
@@ -10473,7 +10543,7 @@ directory should work if nowhere else does.}
\DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
\DeclareUnicodeCharacter{00AF}{\={ }}%
%
- \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
+ \DeclareUnicodeCharacter{00B0}{\textdegree}%
\DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
\DeclareUnicodeCharacter{00B2}{$^2$}%
\DeclareUnicodeCharacter{00B3}{$^3$}%
@@ -10977,7 +11047,7 @@ directory should work if nowhere else does.}
%
\DeclareUnicodeCharacter{20AC}{\euro{}}%
%
- \DeclareUnicodeCharacter{2192}{\expansion{}}%
+ \DeclareUnicodeCharacter{2192}{\arrow}%
\DeclareUnicodeCharacter{21D2}{\result{}}%
%
% Mathematical symbols
@@ -11188,14 +11258,14 @@ directory should work if nowhere else does.}
\relax
}
-% Define all Unicode characters we know about. This makes UTF-8 the default
-% input encoding and allows @U to work.
+% Define all Unicode characters we know about
\iftxinativeunicodecapable
\nativeunicodechardefsatu
\else
\utfeightchardefs
\fi
+
\message{formatting,}
\newdimen\defaultparindent \defaultparindent = 15pt
@@ -11438,17 +11508,18 @@ directory should work if nowhere else does.}
\mtadjustprotcode#1\relax
}
+\newcount\countC
\def\mtadjustprotcode#1{%
- \countA=0
+ \countC=0
\loop
- \ifcase\lpcode#1\countA\else
- \mtadjustcp\lpcode#1\countA
+ \ifcase\lpcode#1\countC\else
+ \mtadjustcp\lpcode#1\countC
\fi
- \ifcase\rpcode#1\countA\else
- \mtadjustcp\rpcode#1\countA
+ \ifcase\rpcode#1\countC\else
+ \mtadjustcp\rpcode#1\countC
\fi
- \advance\countA 1
- \ifnum\countA < 256 \repeat
+ \advance\countC 1
+ \ifnum\countC < 256 \repeat
}
\newcount\countB
@@ -11522,7 +11593,7 @@ directory should work if nowhere else does.}
\fi
}
-\microtypeON
+\microtypeOFF
\parseargdef\microtype{%
\def\txiarg{#1}%
@@ -11539,6 +11610,9 @@ directory should work if nowhere else does.}
\message{and turning on texinfo input format.}
+% Make UTF-8 the default encoding.
+\documentencodingzzz{UTF-8}
+
\def^^L{\par} % remove \outer, so ^L can appear in an @comment
\catcode`\^^K = 10 % treat vertical tab as whitespace
@@ -11590,7 +11664,7 @@ directory should work if nowhere else does.}
\def\texinfochars{%
\let< = \activeless
\let> = \activegtr
- \let~ = \activetilde
+ \let~ = \activetilde
\let^ = \activehat
\setregularquotes
\let\b = \strong
@@ -11601,23 +11675,32 @@ directory should work if nowhere else does.}
% Used sometimes to turn off (effectively) the active characters even after
% parsing them.
\def\turnoffactive{%
- \normalturnoffactive
+ \passthroughcharstrue
+ \let-=\normaldash
+ \let"=\normaldoublequote
+ \let$=\normaldollar %$ font-lock fix
+ \let+=\normalplus
+ \let<=\normalless
+ \let>=\normalgreater
+ \let^=\normalcaret
+ \let_=\normalunderscore
+ \let|=\normalverticalbar
+ \let~=\normaltilde
\otherbackslash
+ \setregularquotes
+ \unsepspaces
}
-\catcode`\@=0
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \loadconf turn them back on.
+\catcode`+=\other \catcode`\_=\other
+
% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
\global\chardef\backslashcurfont=`\\
-% \realbackslash is an actual character `\' with catcode other.
-{\catcode`\\=\other @gdef@realbackslash{\}}
-
-% In Texinfo, backslash is an active character; it prints the backslash
-% in fixed width font.
-\catcode`\\=\active % @ for escape char from now on.
-
% Print a typewriter backslash. For math mode, we can't simply use
% \backslashcurfont: the story here is that in math mode, the \char
% of \backslashcurfont ends up printing the roman \ from the math symbol
@@ -11627,109 +11710,120 @@ directory should work if nowhere else does.}
% ignored family value; char position "5C). We can't use " for the
% usual hex value because it has already been made active.
-@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
-@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
-
-% \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other.
-@gdef@otherbackslash{@let\=@realbackslash}
-
-% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.
-%
-{@catcode`- = @active
- @gdef@normalturnoffactive{%
- @passthroughcharstrue
- @let-=@normaldash
- @let"=@normaldoublequote
- @let$=@normaldollar %$ font-lock fix
- @let+=@normalplus
- @let<=@normalless
- @let>=@normalgreater
- @let^=@normalcaret
- @let_=@normalunderscore
- @let|=@normalverticalbar
- @let~=@normaltilde
- @let\=@ttbackslash
- @setregularquotes
- @unsepspaces
- }
-}
+\def\ttbackslash{{\tt \ifmmode \mathchar29020 \else \backslashcurfont \fi}}
+\let\backslashchar = \ttbackslash % \backslashchar{} is for user documents.
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have @fixbackslash turn them back on.
-@catcode`+=@other @catcode`@_=@other
-
-% \enablebackslashhack - allow file to begin `\input texinfo'
-%
-% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
-% That is what \eatinput is for; after that, the `\' should revert to printing
-% a backslash.
-% If the file did not have a `\input texinfo', then it is turned off after
-% the first line; otherwise the first `\' in the file would cause an error.
-% This is used on the very last line of this file, texinfo.tex.
-% We also use @c to call @fixbackslash, in case ends of lines are hidden.
-{
-@catcode`@^=7
-@catcode`@^^M=13@gdef@enablebackslashhack{%
- @global@let\ = @eatinput%
- @catcode`@^^M=13%
- @def@c{@fixbackslash@c}%
- % Definition for the newline at the end of this file.
- @def ^^M{@let^^M@secondlinenl}%
- % Definition for a newline in the main Texinfo file.
- @gdef @secondlinenl{@fixbackslash}%
+% These are made active for url-breaking, so need
+% active definitions as the normal characters.
+\def\normaldot{.}
+\def\normalquest{?}
+\def\normalslash{/}
+
+% \newlinesloadsconf - call \loadconf as soon as possible in the
+% file, e.g. at the first newline.
+%
+{\catcode`\^=7
+\catcode`\^^M=13
+\gdef\newlineloadsconf{%
+ \catcode`\^^M=13 %
+ \newlineloadsconfzz%
+}
+\gdef\newlineloadsconfzz#1^^M{%
+ \def\c{\loadconf\c}%
+ % Definition for the first newline read in the file
+ \def ^^M{\loadconf}%
% In case the first line has a whole-line command on it
- @let@originalparsearg@parsearg
- @def@parsearg{@fixbackslash@originalparsearg}
+ \let\originalparsearg\parsearg%
+ \def\parsearg{\loadconf\originalparsearg}%
}}
-{@catcode`@^=7 @catcode`@^^M=13%
-@gdef@eatinput input texinfo#1^^M{@fixbackslash}}
% Emergency active definition of newline, in case an active newline token
% appears by mistake.
-{@catcode`@^=7 @catcode13=13%
-@gdef@enableemergencynewline{%
- @gdef^^M{%
- @par%
- %<warning: active newline>@par%
+{\catcode`\^=7 \catcode13=13%
+\gdef\enableemergencynewline{%
+ \gdef^^M{%
+ \par%
+ %<warning: active newline>\par%
}}}
-@gdef@fixbackslash{%
- @ifx\@eatinput @let\ = @ttbackslash @fi
- @catcode13=5 % regular end of line
- @enableemergencynewline
- @let@c=@comment
- @let@parsearg@originalparsearg
+% \loadconf gets called at the beginning of every Texinfo file.
+% If texinfo.cnf is present on the system, read it. Useful for site-wide
+% @afourpaper, etc. Not opening texinfo.cnf directly in texinfo.tex
+% makes it possible to make a format file for Texinfo.
+%
+\gdef\loadconf{%
+ \relax % Terminate the filename if running as "tex '&texinfo' FILE.texi".
+ %
+ % Turn off the definitions that trigger \loadconf
+ \everyjobreset
+ \catcode13=5 % regular end of line
+ \enableemergencynewline
+ \let\c=\comment
+ \let\parsearg\originalparsearg
+ %
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
- @catcode`+=@active
- @catcode`@_=@active
- %
- % If texinfo.cnf is present on the system, read it.
- % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
- % called at the beginning of every Texinfo file. Not opening texinfo.cnf
- % directly in this file, texinfo.tex, makes it possible to make a format
- % file for Texinfo.
+ \catcode`+=\active
+ \catcode`\_=\active
%
- @openin 1 texinfo.cnf
- @ifeof 1 @else @input texinfo.cnf @fi
- @closein 1
+ \openin 1 texinfo.cnf
+ \ifeof 1 \else \input texinfo.cnf \fi
+ \closein 1
}
+% Redefine some control sequences to be controlled by the \ifdummies
+% and \ifindexnofonts switches. Do this at the end so that the control
+% sequences are all defined.
+\definedummies
+
+
+
+
+\catcode`\@=0
+
+% \realbackslash is an actual character `\' with catcode other.
+{\catcode`\\=\other @gdef@realbackslash{\}}
+
+% In Texinfo, backslash is an active character; it prints the backslash
+% in fixed width font.
+\catcode`\\=\active % @ for escape char from now on.
+
+@let\ = @ttbackslash
+
+% If in a .fmt file, print the version number.
+% \eatinput stops the `\input texinfo' from showing up.
+% After that, `\' should revert to printing a backslash.
+% Turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+%
+@everyjob{@message{[Texinfo version @texinfoversion]}%
+ @global@let\ = @eatinput
+ @catcode`+=@active @catcode`@_=@active}
+
+{@catcode`@^=7 @catcode`@^^M=13%
+@gdef@eatinput input texinfo#1^^M{@loadconf}}
+
+@def@everyjobreset{@ifx\@eatinput @let\ = @ttbackslash @fi}
+
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.
+@gdef@otherbackslash{@let\=@realbackslash}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'.
+%
+{@catcode`- = @active
+ @gdef@normalturnoffactive{%
+ @turnoffactive
+ @let\=@ttbackslash
+ }
+}
% Say @foo, not \foo, in error messages.
@escapechar = `@@
-% These (along with & and #) are made active for url-breaking, so need
-% active definitions as the normal characters.
-@def@normaldot{.}
-@def@normalquest{?}
-@def@normalslash{/}
-
% These look ok in all fonts, so just make them not special.
% @hashchar{} gets its own user-level command, because of #line.
@catcode`@& = @other @def@normalamp{&}
@@ -11744,15 +11838,11 @@ directory should work if nowhere else does.}
@c Do this last of all since we use ` in the previous @catcode assignments.
@catcode`@'=@active
@catcode`@`=@active
-@setregularquotes
@c Local variables:
@c eval: (add-hook 'before-save-hook 'time-stamp nil t)
@c time-stamp-pattern: "texinfoversion{%Y-%02m-%02d.%02H}"
-@c page-delimiter: "^\\\\message\\|emacs-page"
+@c page-delimiter: "^\\\\message"
@c End:
-@c vim:sw=2:
-
-@enablebackslashhack
-
+@newlineloadsconf
diff --git a/unixdir.c b/unixdir.c
index 82ef84d..bcf7f9b 100644
--- a/unixdir.c
+++ b/unixdir.c
@@ -21,6 +21,7 @@
#include "file.h"
#include "htable.h"
#include "mainloop.h"
+#include "file_name.h"
#ifdef HAVE_READDIR
@@ -75,13 +76,8 @@ typedef struct Dir_t {
struct MT_STAT statbuf;
char *pathname;
DIR *dir;
-#ifdef HAVE_FCHDIR
- int fd;
-#endif
} Dir_t;
-/*#define FCHDIR_MODE*/
-
static int get_dir_data(Stream_t *Stream, time_t *date, mt_off_t *size,
int *type, unsigned int *address)
{
@@ -121,14 +117,6 @@ static Class_t DirClass = {
0 /* discard */
};
-#ifdef HAVE_FCHDIR
-#define FCHDIR_MODE
-#endif
-
-int unix_dir_loop(Stream_t *Stream, MainParam_t *mp);
-int unix_loop(Stream_t *Stream, MainParam_t *mp, char *arg,
- int follow_dir_link);
-
int unix_dir_loop(Stream_t *Stream, MainParam_t *mp)
{
DeclareThis(Dir_t);
@@ -136,22 +124,11 @@ int unix_dir_loop(Stream_t *Stream, MainParam_t *mp)
char *newName;
int ret=0;
-#ifdef FCHDIR_MODE
- int fd;
-
- fd = open(".", O_RDONLY);
- if(chdir(This->pathname) < 0) {
- fprintf(stderr, "Could not chdir into %s (%s)\n",
- This->pathname, strerror(errno));
- return -1;
- }
-#endif
while((entry=readdir(This->dir)) != NULL) {
if(got_signal)
break;
if(isSpecial(entry->d_name))
continue;
-#ifndef FCHDIR_MODE
newName = malloc(strlen(This->pathname) + 1 +
strlen(entry->d_name) + 1);
if(!newName) {
@@ -161,19 +138,10 @@ int unix_dir_loop(Stream_t *Stream, MainParam_t *mp)
strcpy(newName, This->pathname);
strcat(newName, "/");
strcat(newName, entry->d_name);
-#else
- newName = entry->d_name;
-#endif
+
ret |= unix_loop(Stream, mp, newName, 0);
-#ifndef FCHDIR_MODE
free(newName);
-#endif
}
-#ifdef FCHDIR_MODE
- if(fchdir(fd) < 0)
- perror("Could not chdir back to ..");
- close(fd);
-#endif
return ret;
}
diff --git a/version.texi b/version.texi
index 440120d..2fab89f 100644
--- a/version.texi
+++ b/version.texi
@@ -1,3 +1,3 @@
-@set EDITION 4.0.42
-@set VERSION 4.0.42
-@set UPDATED October 2022
+@set EDITION 4.0.43
+@set VERSION 4.0.43
+@set UPDATED March 2023
diff --git a/vfat.h b/vfat.h
index 621e591..7bbae76 100644
--- a/vfat.h
+++ b/vfat.h
@@ -60,6 +60,10 @@ void autorename_long(char *, int);
#define DO_OPEN_DIRS 0x400 /* open all directories that are found */
#define OPEN_PARENT 0x1000 /* in target lookup, open parent
* instead of file itself */
-#define NO_UNIX 0x2000 /* in target lookup, consider all files to reside on
- * the DOS fs */
+
+#define DEFERABLE 0x2000 /* When copying from a source with wildcards
+ * to a destination that is not a directory, defer the
+ * copy until the directory has been scanned fully, to
+ * make sure that no multiple files match the wildcard */
+
#endif