#include "base64.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "base64"
#define AUTHORS proper_name ("Simon Josefsson")
#include "error.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "basename"
#define AUTHORS proper_name ("David MacKenzie")
name = base_name (argv[optind]);
strip_trailing_slashes (name);
- /* Per POSIX, `basename // /' must return `//' on platforms with
+ /* Per POSIX, `basename // /' must return '//' on platforms with
distinct //. On platforms with drive letters, this generalizes
- to making `basename c: :' return `c:'. This rule is captured by
+ to making `basename c: :' return 'c:'. This rule is captured by
skipping suffix stripping if base_name returned an absolute path
or a drive letter (only possible if name is a file-system
root). */
#include "safe-read.h"
#include "xfreopen.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "cat"
#define AUTHORS \
'\t', '\0'
};
-/* Position in `line_buf' where printing starts. This will not change
+/* Position in 'line_buf' where printing starts. This will not change
unless the number of lines is larger than 999999. */
static char *line_num_print = line_buf + LINE_COUNTER_BUF_LEN - 8;
-/* Position of the first digit in `line_buf'. */
+/* Position of the first digit in 'line_buf'. */
static char *line_num_start = line_buf + LINE_COUNTER_BUF_LEN - 3;
-/* Position of the last digit in `line_buf'. */
+/* Position of the last digit in 'line_buf'. */
static char *line_num_end = line_buf + LINE_COUNTER_BUF_LEN - 3;
-/* Preserves the `cat' function's local `newlines' between invocations. */
+/* Preserves the 'cat' function's local 'newlines' between invocations. */
static int newlines2 = 0;
void
line_num_print--;
}
-/* Plain cat. Copies the file behind `input_desc' to STDOUT_FILENO.
+/* Plain cat. Copies the file behind 'input_desc' to STDOUT_FILENO.
Return true if successful. */
static bool
goto contin;
}
- /* Select which version of `cat' to use. If any format-oriented
- options were given use `cat'; otherwise use `simple_cat'. */
+ /* Select which version of 'cat' to use. If any format-oriented
+ options were given use 'cat'; otherwise use 'simple_cat'. */
if (! (number || show_ends || show_nonprinting
|| show_tabs || squeeze_blank))
#include "selinux-at.h"
#include "xfts.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "chcon"
#define AUTHORS \
/* Level of verbosity. */
static bool verbose;
-/* Pointer to the device and inode numbers of `/', when --recursive.
+/* Pointer to the device and inode numbers of '/', when --recursive.
Otherwise NULL. */
static struct dev_ino *root_dev_ino;
#include "root-dev-ino.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "chgrp"
#define AUTHORS \
#include "root-dev-ino.h"
#include "xfts.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "chmod"
#define AUTHORS \
/* Level of verbosity. */
static enum Verbosity verbosity = V_off;
-/* Pointer to the device and inode numbers of `/', when --recursive.
+/* Pointer to the device and inode numbers of '/', when --recursive.
Otherwise NULL. */
static struct dev_ino *root_dev_ino;
/* Change the owner and/or group of the FILE to UID and/or GID (safely)
only if REQUIRED_UID and REQUIRED_GID match the owner and group IDs
- of FILE. ORIG_ST must be the result of `stat'ing FILE.
+ of FILE. ORIG_ST must be the result of 'stat'ing FILE.
- The `safely' part above means that we can't simply use chown(2),
+ The 'safely' part above means that we can't simply use chown(2),
since FILE might be replaced with some other file between the time
of the preceding stat/lstat and this chown call. So here we open
FILE and do everything else via the resulting file descriptor.
}
/* On some systems (e.g., GNU/Linux 2.4.x),
- the chown function resets the `special' permission bits.
+ the chown function resets the 'special' permission bits.
Do *not* restore those bits; doing so would open a window in
which a malicious user, M, could subvert a chown command run
by some other user and operating on files in a directory
#include "root-dev-ino.h"
#include "userspec.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "chown"
#define AUTHORS \
#include "userspec.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "chroot"
#define AUTHORS proper_name ("Roland McGrath")
crctab > crctab.h
This software is compatible with neither the System V nor the BSD
- `sum' program. It is supposed to conform to POSIX, except perhaps
+ 'sum' program. It is supposed to conform to POSIX, except perhaps
for foreign language support. Any inconsistency with the standard
(other than foreign language support) is a bug. */
#include <config.h>
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "cksum"
#define AUTHORS proper_name ("Q. Frank Xia")
#include "memcmp2.h"
#include "xmemcoll.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "comm"
#define AUTHORS \
A message is printed at most once per input file.
- This funtion was copied (nearly) verbatim from `src/join.c'. */
+ This funtion was copied (nearly) verbatim from 'src/join.c'. */
static void
check_order (struct linebuffer const *prev,
/* Copy a regular file from SRC_NAME to DST_NAME.
If the source file contains holes, copies holes and blocks of zeros
in the source file as holes in the destination file.
- (Holes are read as zeroes by the `read' system call.)
+ (Holes are read as zeroes by the 'read' system call.)
When creating the destination, use DST_MODE & ~OMITTED_PERMISSIONS
as the third argument in the call to open, adding
OMITTED_PERMISSIONS after copying as needed.
}
/* Return true if it's ok that the source and destination
- files are the `same' by some measure. The goal is to avoid
- making the `copy' operation remove both copies of the file
+ files are the 'same' by some measure. The goal is to avoid
+ making the 'copy' operation remove both copies of the file
in that case, while still allowing the user to e.g., move or
copy a regular file onto a symlink that points to it.
Try to minimize the cost of this function in the common case.
work to do and should return successfully, right away.
Set *UNLINK_SRC if we've determined that the caller wants to do
- `rename (a, b)' where `a' and `b' are distinct hard links to the same
- file. In that case, the caller should try to unlink `a' and then return
+ `rename (a, b)' where 'a' and 'b' are distinct hard links to the same
+ file. In that case, the caller should try to unlink 'a' and then return
successfully. Ideally, we wouldn't have to do that, and we'd be
able to rely on rename to remove the source file. However, POSIX
mistakenly requires that such a rename call do *nothing* and return
/* FIXME-note: even with the following kludge, we can still provoke
the offending diagnostic. It's just a little harder to do :-)
$ rm -f a b c; touch c; ln -s c b; ln -s b a; cp -b a b
- cp: cannot open `a' for reading: No such file or directory
- That's misleading, since a subsequent `ls' shows that `a'
+ cp: cannot open 'a' for reading: No such file or directory
+ That's misleading, since a subsequent 'ls' shows that 'a'
is still there.
One solution would be to open the source file *before* moving
aside the destination, but that'd involve a big rewrite. */
/* They may refer to the same file if we're in move mode and the
target is a symlink. That is ok, since we remove any existing
- destination file before opening it -- via `rename' if they're on
+ destination file before opening it -- via 'rename' if they're on
the same file system, via `unlink (DST_NAME)' otherwise.
It's also ok if they're distinct hard links to the same file. */
if (x->move_mode || x->unlink_dest_before_opening)
/* When effecting a move (e.g., for mv(1)), and given the name DST_NAME
of the destination and a corresponding stat buffer, DST_SB, return
- true if the logical `move' operation should _not_ proceed.
+ true if the logical 'move' operation should _not_ proceed.
Otherwise, return false.
Depending on options specified in X, this code may issue an
interactive prompt asking whether it's ok to overwrite DST_NAME. */
&& ! yesno ()));
}
-/* Print --verbose output on standard output, e.g. `new' -> `old'.
+/* Print --verbose output on standard output, e.g. 'new' -> 'old'.
If BACKUP_DST_NAME is non-NULL, then also indicate that it is
the name of a backup file. */
static void
/* When there is an existing destination file, we may end up
returning early, and hence not copying/moving the file.
- This may be due to an interactive `negative' reply to the
+ This may be due to an interactive 'negative' reply to the
prompt about the existing file. It may also be due to the
use of the --reply=no option.
This mv command must fail (likewise for cp):
rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
Otherwise, the contents of b/f would be lost.
- In the case of `cp', b/f would be lost if the user simulated
+ In the case of 'cp', b/f would be lost if the user simulated
a move using cp and rm.
Note that it works fine if you use --backup=numbered. */
if (command_line_arg
destroy the source file. Before, running the commands
cd /tmp; rm -f a a~; : > a; echo A > a~; cp --b=simple a~ a
would leave two zero-length files: a and a~. */
- /* FIXME: but simply change e.g., the final a~ to `./a~'
+ /* FIXME: but simply change e.g., the final a~ to './a~'
and the source will still be destroyed. */
if (STREQ (tmp_backup, src_name))
{
to overwrite that file again, we can detect it and fail. */
/* It's fine to use the _source_ stat buffer (src_sb) to get the
_destination_ dev/ino, since the rename above can't have
- changed those, and `mv' always uses lstat.
+ changed those, and 'mv' always uses lstat.
We could limit it further by operating
only on non-directories. */
record_file (x->dest_info, dst_name, &src_sb);
e-mail. One way to do that is to run a command like this
find /usr/include/. -type f \
| xargs grep 'define.*\<E[A-Z]*\>.*\<18\>' /dev/null
- where you'd replace `18' with the integer in parentheses that
+ where you'd replace '18' with the integer in parentheses that
was output from the perl one-liner above.
- If necessary, of course, change `/tmp' to some other directory. */
+ If necessary, of course, change '/tmp' to some other directory. */
if (errno != EXDEV)
{
/* There are many ways this can happen due to a race condition.
subsequent rename, we can get many different types of errors.
For example, if the destination is initially a non-directory
or non-existent, but it is created as a directory, the rename
- fails. If two `mv' commands try to rename the same file at
+ fails. If two 'mv' commands try to rename the same file at
about the same time, one will succeed and the other will fail.
If the permissions on the directory containing the source or
destination file are made too restrictive, the rename will
}
/* The rename attempt has failed. Remove any existing destination
- file so that a cross-device `mv' acts as if it were really using
+ file so that a cross-device 'mv' acts as if it were really using
the rename syscall. */
if (unlink (dst_name) != 0 && errno != ENOENT)
{
the former). Yet cp, invoked with `--link --no-dereference',
should not follow the link. We can approximate the desired
behavior by skipping this hard-link creating block and instead
- copying the symlink, via the `S_ISLNK'- copying code below.
+ copying the symlink, via the 'S_ISLNK'- copying code below.
LINK_FOLLOWS_SYMLINKS is tri-state; if it is -1, we don't know
how link() behaves, so we use the fallback case for safety.
if (x->preserve_ownership)
{
- /* Preserve the owner and group of the just-`copied'
+ /* Preserve the owner and group of the just-'copied'
symbolic link, if possible. */
if (HAVE_LCHOWN
&& lchown (dst_name, src_sb.st_uid, src_sb.st_gid) != 0
If we've just added a dev/ino entry via the remember_copied
call above (i.e., unless we've just failed to create a hard link),
remove the entry associating the source dev/ino with the
- destination file name, so we don't try to `preserve' a link
+ destination file name, so we don't try to 'preserve' a link
to a file we didn't create. */
if (earlier_file == NULL)
forget_created (src_sb.st_ino, src_sb.st_dev);
}
/* Compare two Src_to_dest entries.
- Return true if their keys are judged `equal'. */
+ Return true if their keys are judged 'equal'. */
static bool
src_to_dest_compare (void const *x, void const *y)
{
/* Determine whether there was already an entry in the table
with a matching key. If so, free ENT (it wasn't inserted) and
- return the `name' from the table entry. */
+ return the 'name' from the table entry. */
if (ent_from_table != ent)
{
src_to_dest_free (ent);
xalloc_die ();
}
-/* Reset the hash structure in the global variable `htab' to
+/* Reset the hash structure in the global variable 'htab' to
contain no entries. */
extern void
} \
while (0)
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "cp"
#define AUTHORS \
The command `cp --parents --preserve a/b/c d/e_dir' changes the
attributes of the directories d/e_dir/a and d/e_dir/a/b to match
the corresponding source directories regardless of whether they
- existed before the `cp' command was given.
+ existed before the 'cp' command was given.
Return true if the parent of CONST_DST_NAME and any intermediate
directories specified by ATTR_LIST have the proper permissions
{
struct dir_attr *p;
char *dst_name; /* A copy of CONST_DST_NAME we can change. */
- char *src_name; /* The source name in `dst_name'. */
+ char *src_name; /* The source name in 'dst_name'. */
ASSIGN_STRDUPA (dst_name, const_dst_name);
src_name = dst_name + src_offset;
*new_dst = false;
*slash++ = '/';
- /* Avoid unnecessary calls to `stat' when given
+ /* Avoid unnecessary calls to 'stat' when given
file names containing multiple adjacent slashes. */
while (*slash == '/')
slash++;
if (target_directory)
{
/* cp file1...filen edir
- Copy the files `file1' through `filen'
- to the existing directory `edir'. */
+ Copy the files 'file1' through 'filen'
+ to the existing directory 'edir'. */
int i;
/* Initialize these hash tables only if we'll need them.
{
char *arg_no_trailing_slash;
- /* Use `arg' without trailing slashes in constructing destination
+ /* Use 'arg' without trailing slashes in constructing destination
file names. Otherwise, we can end up trying to create a
directory via `mkdir ("dst/foo/"...', which is not portable.
It fails, due to the trailing slash, on at least
ASSIGN_STRDUPA (arg_no_trailing_slash, arg);
strip_trailing_slashes (arg_no_trailing_slash);
- /* Append all of `arg' (minus any trailing slash) to `dest'. */
+ /* Append all of 'arg' (minus any trailing slash) to 'dest'. */
dst_name = file_name_concat (target_directory,
arg_no_trailing_slash,
&arg_in_concat);
else
{
char *arg_base;
- /* Append the last component of `arg' to `target_directory'. */
+ /* Append the last component of 'arg' to 'target_directory'. */
ASSIGN_BASENAME_STRDUPA (arg_base, arg);
- /* For `cp -R source/.. dest', don't copy into `dest/..'. */
+ /* For `cp -R source/.. dest', don't copy into 'dest/..'. */
dst_name = (STREQ (arg_base, "..")
? xstrdup (target_directory)
: file_name_concat (target_directory, arg_base,
static struct cp_options x_tmp;
new_dest = find_backup_file_name (dest, x->backup_type);
- /* Set x->backup_type to `no_backups' so that the normal backup
+ /* Set x->backup_type to 'no_backups' so that the normal backup
mechanism is not used when performing the actual copy.
- backup_type must be set to `no_backups' only *after* the above
+ backup_type must be set to 'no_backups' only *after* the above
call to find_backup_file_name -- that function uses
backup_type to determine the suffix it applies. */
x_tmp = *x;
PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_CONTEXT, PRESERVE_XATTR,
PRESERVE_ALL
};
- /* Valid arguments to the `--preserve' option. */
+ /* Valid arguments to the '--preserve' option. */
static char const* const preserve_args[] =
{
"mode", "timestamps",
case PRESERVE_ATTRIBUTES_OPTION:
if (optarg == NULL)
{
- /* Fall through to the case for `p' below. */
+ /* Fall through to the case for 'p' below. */
}
else
{
#include "stdio--.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "csplit"
#define AUTHORS \
uintmax_t lines_required; /* Number of lines required. */
uintmax_t repeat; /* Repeat count. */
int argnum; /* ARGV index. */
- bool repeat_forever; /* True if `*' used as a repeat count. */
+ bool repeat_forever; /* True if '*' used as a repeat count. */
bool ignore; /* If true, produce no output (for regexp). */
bool regexpr; /* True if regular expression was used. */
struct re_pattern_buffer re_compiled; /* Compiled regular expression. */
/* Partially read line. */
static char *hold_area = NULL;
-/* Number of bytes in `hold_area'. */
+/* Number of bytes in 'hold_area'. */
static size_t hold_count = 0;
/* Number of the last line in the buffers. */
the input file. */
static struct control *controls;
-/* Number of elements in `controls'. */
+/* Number of elements in 'controls'. */
static size_t control_used;
/* The set of signals that are caught. */
bytes_avail = b->bytes_alloc; /* Size of buffer returned. */
p = b->buffer;
- /* First check the `holding' area for a partial line. */
+ /* First check the 'holding' area for a partial line. */
if (hold_count)
{
memcpy (p, hold_area, hold_count);
#include "quote.h"
#include "xstrndup.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "cut"
#define AUTHORS \
/* The largest field or byte index used as an endpoint of a closed
or degenerate range specification; this doesn't include the starting
index of right-open-ended ranges. For example, with either range spec
- `2-5,9-', `2-3,5,9-' this variable would be set to 5. */
+ '2-5,9-', '2-3,5,9-' this variable would be set to 5. */
static size_t max_range_endpoint;
/* If nonzero, this is the index of the first field in a range that goes
#define HT_RANGE_START_INDEX_INITIAL_CAPACITY 31
/* The set of range-start indices. For example, given a range-spec list like
- `-b1,3-5,4-9,15-', the following indices will be recorded here: 1, 3, 15.
- Note that although `4' looks like a range-start index, it is in the middle
- of the `3-5' range, so it doesn't count.
+ '-b1,3-5,4-9,15-', the following indices will be recorded here: 1, 3, 15.
+ Note that although '4' looks like a range-start index, it is in the middle
+ of the '3-5' range, so it doesn't count.
This table is created/used IFF output_delimiter_specified is set. */
static Hash_table *range_start_ht;
static inline void
mark_range_start (size_t i)
{
- /* Record the fact that `i' is a range-start index. */
+ /* Record the fact that 'i' is a range-start index. */
void *ent_from_table = hash_insert (range_start_ht, (void*) i);
if (ent_from_table == NULL)
{
array. If there is a right-open-ended range, set EOL_RANGE_START
to its starting index. FIELDSTR should be composed of one or more
numbers or ranges of numbers, separated by blanks or commas.
- Incomplete ranges may be given: `-m' means `1-m'; `n-' means `n'
+ Incomplete ranges may be given: '-m' means '1-m'; 'n-' means 'n'
through end of line. Return true if FIELDSTR contains at least
one field specification, false otherwise. */
but only a few fields/byte-offsets are actually selected, use a
hash table. If the range of selected fields is too large, and
too many are selected, then resort to using the range-pairs (the
- `rp' array) directly. */
+ 'rp' array) directly. */
static bool
set_fields (const char *fieldstr)
FATAL_ERROR (_("invalid range with no endpoint: -"));
/* A range. Possibilities: -n, m-n, n-.
- In any case, `initial' contains the start of the range. */
+ In any case, 'initial' contains the start of the range. */
if (!rhs_specified)
{
- /* `n-'. From `initial' to end of line. */
+ /* 'n-'. From 'initial' to end of line. */
eol_range_start = initial;
field_found = true;
}
else
{
- /* `m-n' or `-n' (1-n). */
+ /* 'm-n' or '-n' (1-n). */
if (value < initial)
FATAL_ERROR (_("invalid decreasing range"));
/* Allocate an array large enough so that it may be indexed by
the field numbers corresponding to all finite ranges
- (i.e. `2-6' or `-4', but not `5-') in FIELDSTR. */
+ (i.e. '2-6' or '-4', but not '5-') in FIELDSTR. */
printable_field = xzalloc (max_range_endpoint / CHAR_BIT + 1);
ungetc (c, stream);
/* To support the semantics of the -s flag, we may have to buffer
- all of the first field to determine whether it is `delimited.'
+ all of the first field to determine whether it is 'delimited.'
But that is unnecessary if all non-delimited lines must be printed
and the first field has been selected, or if non-delimited lines
must be suppressed and the first field has *not* been selected.
#include "stat-time.h"
#include "fprintftime.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "date"
#define AUTHORS proper_name ("David MacKenzie")
#include "xstrtol.h"
#include "xtime.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "dd"
#define AUTHORS \
/* Conversion buffer size, in bytes. 0 prevents conversions. */
static size_t conversion_blocksize = 0;
-/* Skip this many records of `input_blocksize' bytes before input. */
+/* Skip this many records of 'input_blocksize' bytes before input. */
static uintmax_t skip_records = 0;
-/* Skip this many records of `output_blocksize' bytes before output. */
+/* Skip this many records of 'output_blocksize' bytes before output. */
static uintmax_t seek_records = 0;
/* Copy only this many records. The default is effectively infinity. */
/* Output buffer. */
static char *obuf;
-/* Current index into `obuf'. */
+/* Current index into 'obuf'. */
static size_t oc = 0;
-/* Index into current line, for `conv=block' and `conv=unblock'. */
+/* Index into current line, for 'conv=block' and 'conv=unblock'. */
static size_t col = 0;
/* The set of signals that are caught. */
return total_written;
}
-/* Write, then empty, the output buffer `obuf'. */
+/* Write, then empty, the output buffer 'obuf'. */
static void
write_output (void)
*cp = trans_table[to_uchar (*cp)];
}
-/* If true, the last char from the previous call to `swab_buffer'
- is saved in `saved_char'. */
+/* If true, the last char from the previous call to 'swab_buffer'
+ is saved in 'saved_char'. */
static bool char_is_saved = false;
/* Odd char from previous call. */
}
/* Copy NREAD bytes of BUF, doing conv=block
- (pad newline-terminated records to `conversion_blocksize',
+ (pad newline-terminated records to 'conversion_blocksize',
replacing the newline with trailing spaces). */
static void
}
/* Copy NREAD bytes of BUF, doing conv=unblock
- (replace trailing spaces in `conversion_blocksize'-sized records
+ (replace trailing spaces in 'conversion_blocksize'-sized records
with a newline). */
static void
pending_spaces++;
else
{
- /* `c' is the character after a run of spaces that were not
+ /* 'c' is the character after a run of spaces that were not
at the end of the conversion buffer. Output them. */
while (pending_spaces)
{
int exit_status = EXIT_SUCCESS;
size_t n_bytes_read;
- /* Leave at least one extra byte at the beginning and end of `ibuf'
+ /* Leave at least one extra byte at the beginning and end of 'ibuf'
for conv=swab, but keep the buffer address even. But some peculiar
device drivers work only with word-aligned buffers, so leave an
extra two bytes. */
if ((conversions_mask & C_BLOCK) && col > 0)
{
/* If the final input line didn't end with a '\n', pad
- the output block to `conversion_blocksize' chars. */
+ the output block to 'conversion_blocksize' chars. */
size_t i;
for (i = col; i < conversion_blocksize; i++)
output_char (space_character);
| (seek_records || (conversions_mask & C_NOTRUNC) ? 0 : O_TRUNC));
/* Open the output file with *read* access only if we might
- need to read to satisfy a `seek=' request. If we can't read
+ need to read to satisfy a 'seek=' request. If we can't read
the file, go ahead with write-only access; it might work. */
if ((! seek_records
|| fd_reopen (STDOUT_FILENO, output_file, O_RDWR | opts, perms) < 0)
#include "quote.h"
#include "find-mount-point.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "df"
#define AUTHORS \
/* True if a file system has been processed for output. */
static bool file_systems_processed;
-/* If true, invoke the `sync' system call before getting any usage data.
+/* If true, invoke the 'sync' system call before getting any usage data.
Using this option can make df very slow, especially with many or very
busy disks. Note that this may make a difference on some systems --
SunOS 4.1.3, for one. It is *not* necessary on GNU/Linux. */
};
/* Linked list of file system types to display.
- If `fs_select_list' is NULL, list all types.
+ If 'fs_select_list' is NULL, list all types.
This table is generated dynamically from command-line options,
rather than hardcoding into the program what it thinks are the
valid file system types; let the user specify any file system type
}
/* Determine what kind of node NAME is and show the disk usage
- for it. STATP is the results of `stat' on NAME. */
+ for it. STATP is the results of 'stat' on NAME. */
static void
get_entry (char const *name, struct stat const *statp)
#include "stdio--.h"
#include "xstrndup.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "dircolors"
#define AUTHORS proper_name ("H. Peter Anvin")
exit (status);
}
-/* If the SHELL environment variable is set to `csh' or `tcsh,'
+/* If the SHELL environment variable is set to 'csh' or 'tcsh,'
assume C shell. Else Bourne shell. */
static enum Shell_syntax
#include "error.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "dirname"
#define AUTHORS \
extern bool fts_debug;
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "du"
#define AUTHORS \
};
ARGMATCH_VERIFY (time_args, time_types);
-/* `full-iso' uses full ISO-style dates and times. `long-iso' uses longer
- ISO-style time stamps, though shorter than `full-iso'. `iso' uses shorter
+/* 'full-iso' uses full ISO-style dates and times. 'long-iso' uses longer
+ ISO-style time stamps, though shorter than 'full-iso'. 'iso' uses shorter
ISO-style time stamps. */
enum time_style
{
error (0, 0, "%s", _("invalid zero-length file name"));
else
{
- /* Using the standard `filename:line-number:' prefix here is
+ /* Using the standard 'filename:line-number:' prefix here is
not totally appropriate, since NUL is the separator, not NL,
but it might be better than nothing. */
unsigned long int file_number = argv_iter_n_args (ai);
#include <sys/types.h>
#include "system.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "echo"
#define AUTHORS \
}
/* Print the words in LIST to standard output. If the first word is
- `-n', then don't print a trailing newline. We also support the
+ '-n', then don't print a trailing newline. We also support the
echo syntax from Version 9 unix systems. */
int
#include "error.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "env"
#define AUTHORS \
#include "quote.h"
#include "xstrndup.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "expand"
#define AUTHORS proper_name ("David MacKenzie")
read on the line. */
static bool convert_entire_line;
-/* If nonzero, the size of all tab stops. If zero, use `tab_list' instead. */
+/* If nonzero, the size of all tab stops. If zero, use 'tab_list' instead. */
static uintmax_t tab_size;
/* Array of the explicit column numbers of the tab stops;
- after `tab_list' is exhausted, each additional tab is replaced
+ after 'tab_list' is exhausted, each additional tab is replaced
by a space. The first column is column 0. */
static uintmax_t *tab_list;
-/* The number of allocated entries in `tab_list'. */
+/* The number of allocated entries in 'tab_list'. */
static size_t n_tabs_allocated;
-/* The index of the first invalid element of `tab_list',
+/* The index of the first invalid element of 'tab_list',
where the next element can be added. */
static size_t first_free_tab;
/* Null-terminated array of input filenames. */
static char **file_list;
-/* Default for `file_list' if no files are given on the command line. */
+/* Default for 'file_list' if no files are given on the command line. */
static char *stdin_argv[] =
{
(char *) "-", NULL
exit (status);
}
-/* Add tab stop TABVAL to the end of `tab_list'. */
+/* Add tab stop TABVAL to the end of 'tab_list'. */
static void
add_tab_stop (uintmax_t tabval)
/* Close the old stream pointer FP if it is non-NULL,
and return a new one opened to read the next input file.
- Open a filename of `-' as the standard input.
+ Open a filename of '-' as the standard input.
Return NULL if there are no more input files. */
static FILE *
}
/* Change tabs to spaces, writing to stdout.
- Read each file in `file_list', in order. */
+ Read each file in 'file_list', in order. */
static void
expand (void)
}
#endif
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "expr"
#define AUTHORS \
usage, AUTHORS, (char const *) NULL);
/* The above handles --help and --version.
- Since there is no other invocation of getopt, handle `--' here. */
+ Since there is no other invocation of getopt, handle '--' here. */
unsigned int u_argc = argc;
if (1 < u_argc && STREQ (argv[1], "--"))
{
#include "readtokens.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "factor"
#define AUTHORS proper_name ("Paul Rubin")
#include "quote.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "fmt"
#define AUTHORS proper_name ("Ross Paterson")
}
}
-/* Set the global variable `other_indent' according to SAME_PARAGRAPH
+/* Set the global variable 'other_indent' according to SAME_PARAGRAPH
and other global variables. */
static void
start->line_length = len;
}
- /* This is a kludge to keep us from computing `len' as the
+ /* This is a kludge to keep us from computing 'len' as the
sum of the sentinel length and some non-zero number.
Since the sentinel w->length may be INT_MAX, adding
to that would give a negative result. */
#define TAB_WIDTH 8
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "fold"
#define AUTHORS proper_name ("David MacKenzie")
FILE *istream;
int c;
size_t column = 0; /* Screen column where next char will go. */
- size_t offset_out = 0; /* Index in `line_out' for next char. */
+ size_t offset_out = 0; /* Index in 'line_out' for next char. */
static char *line_out = NULL;
static size_t allocated_out = 0;
int saved_errno;
#include "error.h"
#include "group-list.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "groups"
#define AUTHORS \
/* Options: (see usage)
Reads from standard input if no files are given or when a filename of
- ``-'' is encountered.
+ ''-'' is encountered.
By default, filename headers are printed only if more than one file
is given.
By default, prints the first 10 lines (head -n 10).
#include "xfreopen.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "head"
#define AUTHORS \
if (bytes_remaining <= n_elide)
return true;
- /* Seek back to `current' position, then copy the required
+ /* Seek back to 'current' position, then copy the required
number of bytes from fd. */
if (lseek (fd, 0, current_pos) == -1)
{
total_lines += tmp->nlines;
/* If there is enough room in the last buffer read, just append the new
- one to it. This is because when reading from a pipe, `n_read' can
+ one to it. This is because when reading from a pipe, 'n_read' can
often be very small. */
if (tmp->nbytes + last->nbytes < BUFSIZ)
{
size_t bytes_read;
off_t pos = end_pos;
- /* Set `bytes_read' to the size of the last, probably partial, buffer;
- 0 < `bytes_read' <= `BUFSIZ'. */
+ /* Set 'bytes_read' to the size of the last, probably partial, buffer;
+ 0 < 'bytes_read' <= 'BUFSIZ'. */
bytes_read = (pos - start_pos) % BUFSIZ;
if (bytes_read == 0)
bytes_read = BUFSIZ;
- /* Make `pos' a multiple of `BUFSIZ' (0 if the file is short), so that all
+ /* Make 'pos' a multiple of 'BUFSIZ' (0 if the file is short), so that all
reads will be on block boundaries, which might increase efficiency. */
pos -= bytes_read;
if (lseek (fd, pos, SEEK_SET) < 0)
#include "error.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "hostid"
#define AUTHORS proper_name ("Jim Meyering")
#include "quote.h"
#include "xgethostname.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "hostname"
#define AUTHORS proper_name ("Jim Meyering")
#include "quote.h"
#include "group-list.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "id"
#define AUTHORS \
static bool ok = true;
/* The SELinux context. Start with a known invalid value so print_full_info
- knows when `context' has not been set to a meaningful value. */
+ knows when 'context' has not been set to a meaningful value. */
static security_context_t context = NULL;
static struct option const longopts[] =
#include "utimens.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "install"
#define AUTHORS proper_name ("David MacKenzie")
the current user ID. */
static char *owner_name;
-/* The user ID corresponding to `owner_name'. */
+/* The user ID corresponding to 'owner_name'. */
static uid_t owner_id;
/* The group name that will own the files, or NULL to make the group
the current group ID. */
static char *group_name;
-/* The group ID corresponding to `group_name'. */
+/* The group ID corresponding to 'group_name'. */
static gid_t group_id;
#define DEFAULT_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
#include "xstrtol.h"
#include "argmatch.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "join"
#define AUTHORS proper_name ("Mike Haertel")
struct line
{
struct linebuffer buf; /* The line itself. */
- size_t nfields; /* Number of elements in `fields'. */
- size_t nfields_allocated; /* Number of elements allocated for `fields'. */
+ size_t nfields; /* Number of elements in 'fields'. */
+ size_t nfields_allocated; /* Number of elements allocated for 'fields'. */
struct field *fields;
};
same join field value. */
struct seq
{
- size_t count; /* Elements used in `lines'. */
- size_t alloc; /* Elements allocated in `lines'. */
+ size_t count; /* Elements used in 'lines'. */
+ size_t alloc; /* Elements allocated in 'lines'. */
struct line **lines;
};
/* List of fields to print. */
static struct outlist outlist_head;
-/* Last element in `outlist', where a new element can be added. */
+/* Last element in 'outlist', where a new element can be added. */
static struct outlist *outlist_end = &outlist_head;
/* Tab character separating fields. If negative, fields are separated
++(line->nfields);
}
-/* Fill in the `fields' structure in LINE. */
+/* Fill in the 'fields' structure in LINE. */
static void
xfields (struct line *line)
/* Print field N of LINE if it exists and is nonempty, otherwise
- `empty_filler' if it is nonempty. */
+ 'empty_filler' if it is nonempty. */
static void
prfield (size_t n, struct line const *line)
delseq (&seq2);
}
-/* Add a field spec for field FIELD of file FILE to `outlist'. */
+/* Add a field spec for field FIELD of file FILE to 'outlist'. */
static void
add_field (int file, size_t field)
case '0':
if (s[1])
{
- /* `0' must be all alone -- no `.FIELD'. */
+ /* '0' must be all alone -- no '.FIELD'. */
error (EXIT_FAILURE, 0, _("invalid field specifier: %s"), quote (s));
}
*file_index = 0;
}
}
-/* Add the comma or blank separated field spec(s) in STR to `outlist'. */
+/* Add the comma or blank separated field spec(s) in STR to 'outlist'. */
static void
add_field_list (char *str)
#include "sig2str.h"
#include "operand2sig.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "kill"
#define AUTHORS proper_name ("Paul Eggert")
#include "long-options.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "link"
#define AUTHORS proper_name ("Michael Stone")
-/* `ln' program to create links between files.
+/* 'ln' program to create links between files.
Copyright (C) 1986, 1989-1991, 1995-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
#include "same.h"
#include "yesno.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "ln"
#define AUTHORS \
#include "long-options.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "logname"
#define AUTHORS proper_name ("FIXME: unknown")
-/* `dir', `vdir' and `ls' directory listing programs for GNU.
+/* 'dir', 'vdir' and 'ls' directory listing programs for GNU.
Copyright (C) 1985, 1988, 1990-1991, 1995-2012 Free Software Foundation,
Inc.
/* If ls_mode is LS_MULTI_COL,
the multi-column format is the default regardless
of the type of output device.
- This is for the `dir' program.
+ This is for the 'dir' program.
If ls_mode is LS_LONG_FORMAT,
the long format is the default regardless of the
type of output device.
- This is for the `vdir' program.
+ This is for the 'vdir' program.
If ls_mode is LS_LS,
the output format depends on whether the output
device is a terminal.
- This is for the `ls' program. */
+ This is for the 'ls' program. */
/* Written by Richard Stallman and David MacKenzie. */
Most hierarchies are likely to be shallower than this. */
#define INITIAL_TABLE_SIZE 30
-/* The set of `active' directories, from the current command-line argument
+/* The set of 'active' directories, from the current command-line argument
to the level in the hierarchy at which files are being listed.
A directory is represented by its device and inode numbers (struct dev_ino).
A directory is added to this set when ls begins listing it or its
/* The table of files in the current directory:
- `cwd_file' points to a vector of `struct fileinfo', one per file.
- `cwd_n_alloc' is the number of elements space has been allocated for.
- `cwd_n_used' is the number actually in use. */
+ 'cwd_file' points to a vector of `struct fileinfo', one per file.
+ 'cwd_n_alloc' is the number of elements space has been allocated for.
+ 'cwd_n_used' is the number actually in use. */
/* Address of block containing the files that are described. */
static struct fileinfo *cwd_file;
-/* Length of block that `cwd_file' points to, measured in files. */
+/* Length of block that 'cwd_file' points to, measured in files. */
static size_t cwd_n_alloc;
-/* Index of first unused slot in `cwd_file'. */
+/* Index of first unused slot in 'cwd_file'. */
static size_t cwd_n_used;
/* Vector of pointers to files, in proper sorted order, and the number
static size_t sorted_file_alloc;
/* When true, in a color listing, color each symlink name according to the
- type of file it points to. Otherwise, color them according to the `ln'
+ type of file it points to. Otherwise, color them according to the 'ln'
directive in LS_COLORS. Dangling (orphan) symlinks are treated specially,
- regardless. This is set when `ln=target' appears in LS_COLORS. */
+ regardless. This is set when 'ln=target' appears in LS_COLORS. */
static bool color_symlink_as_referent;
{
char *name;
/* If the directory is actually the file pointed to by a symbolic link we
- were told to list, `realname' will contain the name of the symbolic
+ were told to list, 'realname' will contain the name of the symbolic
link, otherwise zero. */
char *realname;
bool command_line_arg;
static enum format format;
-/* `full-iso' uses full ISO-style dates and times. `long-iso' uses longer
- ISO-style time stamps, though shorter than `full-iso'. `iso' uses shorter
- ISO-style time stamps. `locale' uses locale-dependent time stamps. */
+/* 'full-iso' uses full ISO-style dates and times. 'long-iso' uses longer
+ ISO-style time stamps, though shorter than 'full-iso'. 'iso' uses shorter
+ ISO-style time stamps. 'locale' uses locale-dependent time stamps. */
enum time_style
{
full_iso_time_style, /* --time-style=full-iso */
strange characters in file names. */
static bool dired;
-/* `none' means don't mention the type of files.
- `slash' means mention directories only, with a '/'.
- `file_type' means mention file types.
- `classify' means mention file types and mark executables.
+/* 'none' means don't mention the type of files.
+ 'slash' means mention directories only, with a '/'.
+ 'file_type' means mention file types.
+ 'classify' means mention file types and mark executables.
Controlled by -F, -p, and --indicator-style. */
static enum
{
- /* Ignore files whose names start with `.', and files specified by
+ /* Ignore files whose names start with '.', and files specified by
--hide and --ignore. */
IGNORE_DEFAULT,
- /* Ignore `.', `..', and files specified by --ignore. */
+ /* Ignore '.', '..', and files specified by --ignore. */
IGNORE_DOT_AND_DOTDOT,
/* Ignore only files specified by --ignore. */
/* A linked list of shell-style globbing patterns. If a non-argument
file name matches any of these patterns, it is ignored.
Controlled by -I. Multiple -I options accumulate.
- The -B option adds `*~' and `.*~' to this list. */
+ The -B option adds '*~' and '.*~' to this list. */
struct ignore_pattern
{
variable itself to be ignored. */
static struct ignore_pattern *hide_patterns;
-/* True means output nongraphic chars in file names as `?'.
+/* True means output nongraphic chars in file names as '?'.
(-q, --hide-control-chars)
qmark_funny_chars and the quoting style (-Q, --quoting-style=WORD) are
independent. The algorithm is: first, obey the quoting style to get a
string representing the file name; then, if qmark_funny_chars is set,
- replace all nonprintable chars in that string with `?'. It's necessary
+ replace all nonprintable chars in that string with '?'. It's necessary
to replace nonprintable chars even in quoted strings, because we don't
want to mess up the terminal if control chars get sent to it, and some
quoting methods pass through control chars as-is. */
static bool format_needs_stat;
-/* Similar to `format_needs_stat', but set if only the file type is
+/* Similar to 'format_needs_stat', but set if only the file type is
needed. */
static bool format_needs_type;
static struct obstack dired_obstack;
/* With --dired, store pairs of beginning and ending indices of any
- directory names that appear as headers (just before `total' line)
+ directory names that appear as headers (just before 'total' line)
for lists of directory entries. Such directory names are seen when
listing hierarchies using -R and when a directory is listed with at
least one other command line argument. */
sort_files ();
if (!immediate_dirs)
extract_dirs_from_files (NULL, true);
- /* `cwd_n_used' might be zero now. */
+ /* 'cwd_n_used' might be zero now. */
}
- /* In the following if/else blocks, it is sufficient to test `pending_dirs'
+ /* In the following if/else blocks, it is sufficient to test 'pending_dirs'
(and not pending_dirs->name) because there may be no markers in the queue
at this point. A marker may be enqueued when extract_dirs_from_files is
called with a non-empty string or via print_dir. */
switch (ls_mode)
{
case LS_MULTI_COL:
- /* This is for the `dir' program. */
+ /* This is for the 'dir' program. */
format = many_per_line;
set_quoting_style (NULL, escape_quoting_style);
break;
case LS_LONG_FORMAT:
- /* This is for the `vdir' program. */
+ /* This is for the 'vdir' program. */
format = long_format;
set_quoting_style (NULL, escape_quoting_style);
break;
case LS_LS:
- /* This is for the `ls' program. */
+ /* This is for the 'ls' program. */
if (isatty (STDOUT_FILENO))
{
format = many_per_line;
/* If -c or -u is specified and not -l (or any other option that implies -l),
and no sort-type was specified, then sort by the ctime (-c) or atime (-u).
The behavior of ls when using either -c or -u but with neither -l nor -t
- appears to be unspecified by POSIX. So, with GNU ls, `-u' alone means
+ appears to be unspecified by POSIX. So, with GNU ls, '-u' alone means
sort by atime (this is the one that's not specified by the POSIX spec),
-lu means show atime and sort by name, -lut means show atime and sort
by atime. */
DIRED_FPUTS_LITERAL (":\n", stdout);
}
- /* Read the directory entries, and insert the subfiles into the `cwd_file'
+ /* Read the directory entries, and insert the subfiles into the 'cwd_file'
table. */
clear_files ();
print_current_files ();
}
-/* Add `pattern' to the list of patterns for which files that match are
+/* Add 'pattern' to the list of patterns for which files that match are
not listed. */
static void
}
#endif
-/* Enter and remove entries in the table `cwd_file'. */
+/* Enter and remove entries in the table 'cwd_file'. */
static void
free_ent (struct fileinfo *f)
}
/* Put the name of the file that FILENAME is a symbolic link to
- into the LINKNAME field of `f'. COMMAND_LINE_ARG indicates whether
+ into the LINKNAME field of 'f'. COMMAND_LINE_ARG indicates whether
FILENAME is a command-line argument. */
static void
filename);
}
-/* If `linkname' is a relative name and `name' contains one or more
- leading directories, return `linkname' with those directories
- prepended; otherwise, return a copy of `linkname'.
- If `linkname' is zero, return zero. */
+/* If 'linkname' is a relative name and 'name' contains one or more
+ leading directories, return 'linkname' with those directories
+ prepended; otherwise, return a copy of 'linkname'.
+ If 'linkname' is zero, return zero. */
static char *
make_link_name (char const *name, char const *linkname)
return xstrdup (linkname);
/* The link is to a relative name. Prepend any leading directory
- in `name' to the link name. */
+ in 'name' to the link name. */
linkbuf = strrchr (name, '/');
if (linkbuf == 0)
return xstrdup (linkname);
return linkbuf;
}
-/* Return true if the last component of NAME is `.' or `..'
+/* Return true if the last component of NAME is '.' or '..'
This is so we don't try to recurse on `././././. ...' */
static bool
return cmp (a->name, b->name);
}
-/* Compare file extensions. Files with no extension are `smallest'.
+/* Compare file extensions. Files with no extension are 'smallest'.
If extensions are the same, compare by filenames instead. */
static inline int
}
}
-/* Print the file name of `f' with appropriate quoting.
+/* Print the file name of 'f' with appropriate quoting.
Also print file size, inode number, and filetype indicator character,
as requested by switches. */
}
}
-/* Put DIRNAME/NAME into DEST, handling `.' and `/' properly. */
+/* Put DIRNAME/NAME into DEST, handling '.' and '/' properly. */
/* FIXME: maybe remove this function someday. See about using a
non-malloc'ing version of file_name_concat. */
{
while (*dirnamep)
*dest++ = *dirnamep++;
- /* Add '/' if `dirname' doesn't already end with it. */
+ /* Add '/' if 'dirname' doesn't already end with it. */
if (dirnamep > dirname && dirnamep[-1] != '/')
*dest++ = '/';
}
#include "stdio--.h"
#include "xfreopen.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#if HASH_ALGO_MD5
# define PROGRAM_NAME "md5sum"
# define DIGEST_TYPE_STRING "MD5"
if (escaped_filename)
{
- /* Translate each `\n' string in the file name to a NEWLINE,
- and each `\\' string to a backslash. */
+ /* Translate each '\n' string in the file name to a NEWLINE,
+ and each '\\' string to a backslash. */
char *dst = &s[i];
*dst++ = '\\';
break;
default:
- /* Only `\' or `n' may follow a backslash. */
+ /* Only '\' or 'n' may follow a backslash. */
return false;
}
break;
#include "quote.h"
#include "savewd.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "mkdir"
#define AUTHORS proper_name ("David MacKenzie")
#include "modechange.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "mkfifo"
#define AUTHORS proper_name ("David MacKenzie")
#include "quote.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "mknod"
#define AUTHORS proper_name ("David MacKenzie")
}
/* If the number of arguments is 0 or 1,
- or (if it's 2 or more and the second one starts with `p'), then there
+ or (if it's 2 or more and the second one starts with 'p'), then there
must be exactly two operands. Otherwise, there must be four. */
expected_operands = (argc <= optind
|| (optind + 1 < argc && argv[optind + 1][0] == 'p')
switch (argv[optind + 1][0])
{
- case 'b': /* `block' or `buffered' */
+ case 'b': /* 'block' or 'buffered' */
#ifndef S_IFBLK
error (EXIT_FAILURE, 0, _("block special files not supported"));
#else
#endif
goto block_or_character;
- case 'c': /* `character' */
- case 'u': /* `unbuffered' */
+ case 'c': /* 'character' */
+ case 'u': /* 'unbuffered' */
#ifndef S_IFCHR
error (EXIT_FAILURE, 0, _("character special files not supported"));
#else
}
break;
- case 'p': /* `pipe' */
+ case 'p': /* 'pipe' */
if (mkfifo (argv[optind], newmode) != 0)
error (EXIT_FAILURE, errno, "%s", quote (argv[optind]));
break;
#include "stdio--.h"
#include "tempname.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "mktemp"
#define AUTHORS \
#include "root-dev-ino.h"
#include "priv-set.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "mv"
#define AUTHORS \
x->recursive = true;
x->one_file_system = false;
- /* Should we prompt for removal, too? No. Prompting for the `move'
+ /* Should we prompt for removal, too? No. Prompting for the 'move'
part is enough. It implies removal. */
x->interactive = RMI_NEVER;
x->stdin_tty = false;
x->verbose = false;
/* Since this program may well have to process additional command
- line arguments after any call to `rm', that function must preserve
+ line arguments after any call to 'rm', that function must preserve
the initial working directory, in case one of those is a
- `.'-relative name. */
+ '.'-relative name. */
x->require_restore_cwd = true;
{
besides in some situations doing so would give highly nonintuitive
results. Run this `mkdir b; touch a c; mv * b' in an empty
directory. Here's the result of running echo `find b -print`:
- b b/a b/b b/b/a b/c. Notice that only file `a' was copied
+ b b/a b/b b/b/a b/c. Notice that only file 'a' was copied
into b/b. Handle this by giving a diagnostic, removing the
- copied-into-self directory, DEST (`b/b' in the example),
+ copied-into-self directory, DEST ('b/b' in the example),
and failing. */
dir_to_remove = NULL;
supports uploading, downloading and deleting, but not renaming.
Also, note that comparing device numbers is not a reliable
- check for `can-rename'. Some systems can be set up so that
+ check for 'can-rename'. Some systems can be set up so that
files from many different physical devices all have the same
st_dev field. This is a feature of some NFS mounting
configurations.
#include "quote.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "nice"
#define AUTHORS proper_name ("David MacKenzie")
#include "quote.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "nl"
#define AUTHORS \
}
/* Set the command line flag TYPEP and possibly the regex pointer REGEXP,
- according to `optarg'. */
+ according to 'optarg'. */
static bool
build_type_arg (char const **typep,
putchar ('\n');
}
-/* Process a regular text line in `line_buf'. */
+/* Process a regular text line in 'line_buf'. */
static void
proc_text (void)
fwrite (line_buf.buffer, sizeof (char), line_buf.length, stdout);
}
-/* Return the type of line in `line_buf'. */
+/* Return the type of line in 'line_buf'. */
static enum section
check_section (void)
/* Exit statuses. */
enum
{
- /* `nohup' itself failed. */
+ /* 'nohup' itself failed. */
POSIX_NOHUP_FAILURE = 127
};
#include "nproc.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "nproc"
#define AUTHORS proper_name ("Giuseppe Scrivano")
#include "xprintf.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "od"
#define AUTHORS proper_name ("Jim Meyering")
#if HAVE_UNSIGNED_LONG_LONG_INT
typedef unsigned long long int unsigned_long_long_int;
#else
-/* This is just a place-holder to avoid a few `#if' directives.
+/* This is just a place-holder to avoid a few '#if' directives.
In this case, the type isn't actually used. */
typedef unsigned long int unsigned_long_long_int;
#endif
offset and pseudo-start address. */
static bool traditional;
-/* True if an old-style `pseudo-address' was specified. */
+/* True if an old-style 'pseudo-address' was specified. */
static bool flag_pseudo_start;
/* The difference between the old-style pseudo starting address and
if (s[0] == '+')
++s;
- /* Determine the radix we'll use to interpret S. If there is a `.',
- it's decimal, otherwise, if the string begins with `0X'or `0x',
+ /* Determine the radix we'll use to interpret S. If there is a '.',
+ it's decimal, otherwise, if the string begins with '0X'or '0x',
it's hexadecimal, else octal. */
if (strchr (s, '.') != NULL)
radix = 10;
}
/* STRINGS mode. Find each "string constant" in the input.
- A string constant is a run of at least `string_min' ASCII
+ A string constant is a run of at least 'string_min' ASCII
graphic (or formatting) characters terminated by a null.
Based on a function written by Richard Stallman for a
traditional version of od. Return true if successful. */
size_t i;
int c;
- /* See if the next `string_min' chars are all printing chars. */
+ /* See if the next 'string_min' chars are all printing chars. */
tryline:
if (limit_bytes_to_format
buf[i] = c;
}
- /* We found a run of `string_min' printable characters.
+ /* We found a run of 'string_min' printable characters.
Now see if it is terminated with a null byte. */
while (!limit_bytes_to_format || address < end_offset)
{
}
/* If we get here, the string is all printable and null-terminated,
- so print it. It is all in `buf' and `i' is its length. */
+ so print it. It is all in 'buf' and 'i' is its length. */
buf[i] = 0;
format_address (address - i - 1, ' ');
integral_type_size[sizeof (long int)] = LONG;
#if HAVE_UNSIGNED_LONG_LONG_INT
/* If `long int' and `long long int' have the same size, it's fine
- to overwrite the entry for `long' with this one. */
+ to overwrite the entry for 'long' with this one. */
integral_type_size[sizeof (unsigned_long_long_int)] = LONG_LONG;
#endif
fp_type_size[i] = NO_SIZE;
fp_type_size[sizeof (float)] = FLOAT_SINGLE;
- /* The array entry for `double' is filled in after that for `long double'
+ /* The array entry for 'double' is filled in after that for `long double'
so that if they are the same size, we avoid any overhead of
long double computation in libc. */
fp_type_size[sizeof (long double)] = FLOAT_LONG_DOUBLE;
DELIM-LIST instead of tab to separate
merged lines. When DELIM-LIST is exhausted,
start again at its beginning.
- A FILE of `-' means standard input.
+ A FILE of '-' means standard input.
If no FILEs are given, standard input is used. */
#include <config.h>
#include "fadvise.h"
#include "quotearg.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "paste"
#define AUTHORS \
/* The delimeters between lines of input files (used cyclically). */
static char *delims;
-/* A pointer to the character after the end of `delims'. */
+/* A pointer to the character after the end of 'delims'. */
static char const *delim_end;
static struct option const longopts[] =
/* Set up for the next line. */
bool somedone = false;
char const *delimptr = delims;
- size_t delims_saved = 0; /* Number of delims saved in `delbuf'. */
+ size_t delims_saved = 0; /* Number of delims saved in 'delbuf'. */
size_t i;
for (i = 0; i < nfiles && files_open; i++)
}
else
{
- /* Closed file; add delimiter to `delbuf'. */
+ /* Closed file; add delimiter to 'delbuf'. */
if (*delimptr != EMPTY_DELIM)
delbuf[delims_saved++] = *delimptr;
if (++delimptr == delim_end)
saved_errno = errno;
if (charold != EOF)
{
- /* `charold' is set up. Hit it!
- Keep reading characters, stashing them in `charnew';
- output `charold', converting to the appropriate delimiter
- character if needed. After the EOF, output `charold'
+ /* 'charold' is set up. Hit it!
+ Keep reading characters, stashing them in 'charnew';
+ output 'charold', converting to the appropriate delimiter
+ character if needed. After the EOF, output 'charold'
if it's a newline; otherwise, output it and then a newline. */
while ((charnew = getc (fileptr)) != EOF)
#include "quote.h"
#include "quotearg.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "pathchk"
#define AUTHORS \
#include "hard-locale.h"
#include "readutmp.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "pinky"
#define AUTHORS \
/* Create a string (via xmalloc) which contains a full name by substituting
for each ampersand in GECOS_NAME the USER_NAME string with its first
character capitalized. The caller must ensure that GECOS_NAME contains
- no `,'s. The caller also is responsible for free'ing the return value of
+ no ','s. The caller also is responsible for free'ing the return value of
this function. */
static char *
char line[sizeof (utmp_ent->ut_line) + DEV_DIR_LEN + 1];
- /* Copy ut_line into LINE, prepending `/dev/' if ut_line is not
+ /* Copy ut_line into LINE, prepending '/dev/' if ut_line is not
already an absolute file name. Some system may put the full,
absolute file name in ut_line. */
if (utmp_ent->ut_line[0] == '/')
Concept:
If the input_tab_char differs from the default value TAB
- (`-e[CHAR[...]]' is used), any input text tab is expanded to the
+ ('-e[CHAR[...]]' is used), any input text tab is expanded to the
default width of 8 spaces (compare char_to_clump). - Same as SunOS
does.
The treatment of the number_separator (compare add_line_number):
- The default value TAB of the number_separator (`-n[SEP[...]]') doesn't
- be thought to be an input character. An optional `-e'-input has no
+ The default value TAB of the number_separator ('-n[SEP[...]]') doesn't
+ be thought to be an input character. An optional '-e'-input has no
effect.
- With single column output
only one POSIX requirement has to be met:
two conflicting POSIX requirements exist:
First `default n-separator is TAB', second `output text columns shall
be of equal width'. Moreover POSIX specifies the number+separator a
- part of the column, together with `-COLUMN' and `-a -COLUMN'.
+ part of the column, together with '-COLUMN' and `-a -COLUMN'.
(With -m output the number shall occupy each line only once. Exactly
the same situation as single column output exists.)
GNU pr gives priority to the 2nd requirement and observes POSIX
PAGE_WIDTH may occur.
The interference of the POSIX-compliant small letter options -w and -s:
- (`interference' means `setting a _separator_ with -s switches off the
+ ('interference' means `setting a _separator_ with -s switches off the
column structure and the default - not generally - page_width,
acts on -w option')
options: text form / separator: equivalent new options:
-s[CHAR], --separator[=CHAR]
Separate columns by a single character CHAR, default for
CHAR is the TAB character without -w and 'no char' with -w.
- Without `-s' default separator `space' is set.
+ Without '-s' default separator 'space' is set.
-s[CHAR] turns off line truncation of all 3 column options
(-COLUMN|-a -COLUMN|-m) except -w is set. That is a POSIX
compliant formulation. The source code translates -s into
doesn't react upon the -W/-w option (unlike -s option
does). It defines a separator nothing else.
Without -S: Default separator TAB is used with -J and
- `space' otherwise (same as -S" ").
+ 'space' otherwise (same as -S" ").
With -S "": No separator is used.
Quotes should be used with blanks and some shell active
characters.
#include "strftime.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "pr"
#define AUTHORS \
/* String used to separate columns if the -S option has been specified.
Default without -S but together with one of the column options
- -a|COLUMN|-m is a `space' and with the -J option a `tab'. */
+ -a|COLUMN|-m is a 'space' and with the -J option a 'tab'. */
static char *col_sep_string = (char *) "";
static int col_sep_length = 0;
static char *column_separator = (char *) " ";
}
/* Parse column count string S, and if it's valid (1 or larger and
- within range of the type of `columns') set the global variables
+ within range of the type of 'columns') set the global variables
columns and explicit_columns and return true.
Otherwise, exit with a diagnostic. */
static void
/* We've just printed some files and need to clean up things before
looking for more options and printing the next batch of files.
- Free everything we've xmalloc'ed, except `header'. */
+ Free everything we've xmalloc'ed, except 'header'. */
static void
cleanup (void)
/* Exit status for syntax errors, etc. */
enum { PRINTENV_FAILURE = 2 };
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "printenv"
#define AUTHORS \
%b = print an argument string, interpreting backslash escapes,
except that octal escapes are of the form \0 or \0ooo.
- The `format' argument is re-used as many times as necessary
+ The 'format' argument is re-used as many times as necessary
to convert all of the given arguments.
David MacKenzie <djm@gnu.ai.mit.edu> */
#include "unicodeio.h"
#include "xprintf.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "printf"
#define AUTHORS proper_name ("David MacKenzie")
}
/* Print the text in FORMAT, using ARGV (with ARGC elements) for
- arguments to any `%' directives.
+ arguments to any '%' directives.
Return the number of elements of ARGV used. */
static int
print_formatted (const char *format, int argc, char **argv)
{
int save_argc = argc; /* Preserve original value. */
- const char *f; /* Pointer into `format'. */
+ const char *f; /* Pointer into 'format'. */
const char *direc_start; /* Start of % directive. */
size_t direc_length; /* Length of % directive. */
bool have_field_width; /* True if FIELD_WIDTH is valid. */
}
/* The above handles --help and --version.
- Since there is no other invocation of getopt, handle `--' here. */
+ Since there is no other invocation of getopt, handle '--' here. */
if (1 < argc && STREQ (argv[1], "--"))
{
--argc;
#include "stdio--.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "ptx"
/* TRANSLATORS: Please translate "F. Pinard" to "François Pinard"
{
UNKNOWN_FORMAT, /* output format still unknown */
DUMB_FORMAT, /* output for a dumb terminal */
- ROFF_FORMAT, /* output for `troff' or `nroff' */
- TEX_FORMAT /* output for `TeX' or `LaTeX' */
+ ROFF_FORMAT, /* output for 'troff' or 'nroff' */
+ TEX_FORMAT /* output for 'TeX' or 'LaTeX' */
};
static bool gnu_extensions = true; /* trigger all GNU extensions */
-static bool auto_reference = false; /* refs are `file_name:line_number:' */
+static bool auto_reference = false; /* refs are 'file_name:line_number:' */
static bool input_reference = false; /* refs at beginning of input lines */
static bool right_reference = false; /* output refs after right context */
static int line_width = 72; /* output line width in characters */
static int number_input_files; /* number of text input files */
static int total_line_count; /* total number of lines seen so far */
static const char **input_file_name; /* array of text input file names */
-static int *file_line_count; /* array of `total_line_count' values at end */
+static int *file_line_count; /* array of 'total_line_count' values at end */
static BLOCK text_buffer; /* file to study */
/* Occurrences table.
- The `keyword' pointer provides the central word, which is surrounded
- by a left context and a right context. The `keyword' and `length'
+ The 'keyword' pointer provides the central word, which is surrounded
+ by a left context and a right context. The 'keyword' and 'length'
field allow full 8-bit characters keys, even including NULs. At other
- places in this program, the name `keyafter' refers to the keyword
+ places in this program, the name 'keyafter' refers to the keyword
followed by its right context.
The left context does not extend, towards the beginning of the file,
- further than a distance given by the `left' value. This value is
+ further than a distance given by the 'left' value. This value is
relative to the keyword beginning, it is usually negative. This
insures that, except for white space, we will never have to backward
scan the source text, when it is time to generate the final output
The right context, indirectly attainable through the keyword end, does
not extend, towards the end of the file, further than a distance given
- by the `right' value. This value is relative to the keyword
+ by the 'right' value. This value is relative to the keyword
beginning, it is usually positive.
- When automatic references are used, the `reference' value is the
+ When automatic references are used, the 'reference' value is the
overall line number in all input files read so far, in this case, it
- is of type (int). When input references are used, the `reference'
+ is of type (int). When input references are used, the 'reference'
value indicates the distance between the keyword beginning and the
start of the reference field, it is of type (DELTA) and usually
negative. */
static int truncation_string_length;/* length of string that flags truncation */
/* When context is limited by lines, wraparound may happen on final output:
- the `head' pointer gives access to some supplementary left context which
- will be seen at the end of the output line, the `tail' pointer gives
+ the 'head' pointer gives access to some supplementary left context which
+ will be seen at the end of the output line, the 'tail' pointer gives
access to some supplementary right context which will be seen at the
beginning of the output line. */
if (message)
error (EXIT_FAILURE, 0, _("%s (for regexp %s)"), message, quote (string));
- /* The fastmap should be compiled before `re_match'. The following
- call is not mandatory, because `re_search' is always called sooner,
+ /* The fastmap should be compiled before 're_match'. The following
+ call is not mandatory, because 're_search' is always called sooner,
and it compiles the fastmap if this has not been done yet. */
re_compile_fastmap (pattern);
}
/*---------------------------------------------------------------------.
-| Sort the whole occurs table in memory. Presumably, `qsort' does not |
+| Sort the whole occurs table in memory. Presumably, 'qsort' does not |
| take intermediate copies or table elements, so the sort will be |
| stabilized throughout the comparison routine. |
`---------------------------------------------------------------------*/
cursor = next_context_start)
{
- /* `context_start' gets initialized before the processing of each
+ /* 'context_start' gets initialized before the processing of each
line, or once for the whole buffer if no end of line or sentence
sequence separator. */
context_start = cursor;
/* If an end of line or end of sentence sequence is defined and
- non-empty, `next_context_start' will be recomputed to be the end of
+ non-empty, 'next_context_start' will be recomputed to be the end of
each line or sentence, before each one is processed. If no such
- sequence, then `next_context_start' is set at the end of the whole
+ sequence, then 'next_context_start' is set at the end of the whole
buffer, which is then considered to be a single line or sentence.
This test also accounts for the case of an incomplete line or
sentence at the end of the buffer. */
if (possible_key.size > maximum_word_length)
maximum_word_length = possible_key.size;
- /* In input reference mode, update `line_start' from its previous
+ /* In input reference mode, update 'line_start' from its previous
value. Count the lines just in case auto reference mode is
also selected. If it happens that the word just matched is
indeed part of a reference; just ignore it. */
if (auto_reference)
{
- /* While auto referencing, update `line_start' from its
+ /* While auto referencing, update 'line_start' from its
previous value, counting lines as we go. If input
- referencing at the same time, `line_start' has been
+ referencing at the same time, 'line_start' has been
advanced earlier, and the following loop is never really
executed. */
else if (input_reference)
{
- /* If only input referencing, `line_start' has been computed
+ /* If only input referencing, 'line_start' has been computed
earlier to detect the case the word matched would be part
of the reference. The reference position is simply the
- value of `line_start'. */
+ value of 'line_start'. */
occurs_cursor->reference
= (DELTA) (line_start - possible_key.start);
/* First check if this is a diacriticized character.
This works only for TeX. I do not know how diacriticized
- letters work with `roff'. Please someone explain it to me! */
+ letters work with 'roff'. Please someone explain it to me! */
diacritic = todiac (character);
if (diacritic != 0 && output_format == TEX_FORMAT)
else
/* This is not a diacritic character, so handle cases which are
- really specific to `roff' or TeX. All white space processing
+ really specific to 'roff' or TeX. All white space processing
is done as the default case of this switch. */
switch (character)
case ROFF_FORMAT:
- /* `Quote' characters should be doubled. */
+ /* 'Quote' characters should be doubled. */
edited_flag['"'] = 1;
break;
char *cursor; /* running cursor in source text */
char *left_context_start; /* start of left context */
char *right_context_end; /* end of right context */
- char *left_field_start; /* conservative start for `head'/`before' */
+ char *left_field_start; /* conservative start for 'head'/'before' */
int file_index; /* index in text input file arrays */
const char *file_name; /* file name for reference */
int line_ordinal; /* line ordinal for reference */
- /* Define `keyafter', start of left context and end of right context.
- `keyafter' starts at the saved position for keyword and extend to the
+ /* Define 'keyafter', start of left context and end of right context.
+ 'keyafter' starts at the saved position for keyword and extend to the
right from the end of the keyword, eating separators or full words, but
- not beyond maximum allowed width for `keyafter' field or limit for the
+ not beyond maximum allowed width for 'keyafter' field or limit for the
right context. Suffix spaces will be removed afterwards. */
keyafter.start = occurs->key.start;
SKIP_WHITE_BACKWARDS (keyafter.end, keyafter.start);
/* When the left context is wide, it might take some time to catch up from
- the left context boundary to the beginning of the `head' or `before'
+ the left context boundary to the beginning of the 'head' or 'before'
fields. So, in this case, to speed the catchup, we jump back from the
keyword, using some secure distance, possibly falling in the middle of
a word. A secure backward jump would be at least half the maximum
input. We conclude this backward jump by a skip forward of at least
one word. In this manner, we should not inadvertently accept only part
of a word. From the reached point, when it will be time to fix the
- beginning of `head' or `before' fields, we will skip forward words or
+ beginning of 'head' or 'before' fields, we will skip forward words or
delimiters until we get sufficiently near. */
if (-occurs->left > half_line_width + maximum_word_length)
else
left_field_start = keyafter.start + occurs->left;
- /* `before' certainly ends at the keyword, but not including separating
+ /* 'before' certainly ends at the keyword, but not including separating
spaces. It starts after than the saved value for the left context, by
advancing it until it falls inside the maximum allowed width for the
- before field. There will be no prefix spaces either. `before' only
+ before field. There will be no prefix spaces either. 'before' only
advances by skipping single separators or whole words. */
before.start = left_field_start;
tail_truncation = 0;
}
- /* `head' could not take more columns than what has been left in the right
+ /* 'head' could not take more columns than what has been left in the right
context field, and a gap is mandatory. It ends before the left
context, and does not contain suffixed spaces. Its pointer is advanced
until the head field has shrunk to its allowed width. It cannot
/* Formatting and actual output - control routines. */
/*----------------------------------------------------------------------.
-| Output the current output fields as one line for `troff' or `nroff'. |
+| Output the current output fields as one line for 'troff' or 'nroff'. |
`----------------------------------------------------------------------*/
static void
output_one_roff_line (void)
{
- /* Output the `tail' field. */
+ /* Output the 'tail' field. */
printf (".%s \"", macro_name);
print_field (tail);
fputs (truncation_string, stdout);
putchar ('"');
- /* Output the `before' field. */
+ /* Output the 'before' field. */
fputs (" \"", stdout);
if (before_truncation)
print_field (before);
putchar ('"');
- /* Output the `keyafter' field. */
+ /* Output the 'keyafter' field. */
fputs (" \"", stdout);
print_field (keyafter);
fputs (truncation_string, stdout);
putchar ('"');
- /* Output the `head' field. */
+ /* Output the 'head' field. */
fputs (" \"", stdout);
if (head_truncation)
print_field (head);
putchar ('"');
- /* Conditionally output the `reference' field. */
+ /* Conditionally output the 'reference' field. */
if (auto_reference || input_reference)
{
}
/*---------------------------------------------------------.
-| Output the current output fields as one line for `TeX'. |
+| Output the current output fields as one line for 'TeX'. |
`---------------------------------------------------------*/
static void
if (auto_reference)
{
- /* Output the `reference' field, in such a way that GNU emacs
+ /* Output the 'reference' field, in such a way that GNU emacs
next-error will handle it. The ending colon is taken from the
gap which follows. */
else
{
- /* Output the `reference' field and its following gap. */
+ /* Output the 'reference' field and its following gap. */
print_field (reference);
print_spaces (reference_max_width
if (tail.start < tail.end)
{
- /* Output the `tail' field. */
+ /* Output the 'tail' field. */
print_field (tail);
if (tail_truncation)
- (before.end - before.start)
- (before_truncation ? truncation_string_length : 0));
- /* Output the `before' field. */
+ /* Output the 'before' field. */
if (before_truncation)
fputs (truncation_string, stdout);
print_spaces (gap_size);
- /* Output the `keyafter' field. */
+ /* Output the 'keyafter' field. */
print_field (keyafter);
if (keyafter_truncation)
if (head.start < head.end)
{
- /* Output the `head' field. */
+ /* Output the 'head' field. */
print_spaces (half_line_width
- (keyafter.end - keyafter.start)
if ((auto_reference || input_reference) && right_reference)
{
- /* Output the `reference' field. */
+ /* Output the 'reference' field. */
print_spaces (gap_size);
print_field (reference);
}
/* If the output format has not been explicitly selected, choose dumb
- terminal format if GNU extensions are enabled, else `roff' format. */
+ terminal format if GNU extensions are enabled, else 'roff' format. */
if (output_format == UNKNOWN_FORMAT)
output_format = gnu_extensions ? DUMB_FORMAT : ROFF_FORMAT;
#include "root-dev-ino.h"
#include "xgetcwd.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "pwd"
#define AUTHORS proper_name ("Jim Meyering")
memcpy (p->start + 1, s, s_len);
}
-/* Return a string (malloc'd) consisting of N `/'-separated ".." components. */
+/* Return a string (malloc'd) consisting of N '/'-separated ".." components. */
static char *
nth_parent (size_t n)
{
/* Determine the basename of the current directory, where DOT_SB is the
result of lstat'ing "." and prepend that to the file name in *FILE_NAME.
- Find the directory entry in `..' that matches the dev/i-node of DOT_SB.
- Upon success, update *DOT_SB with stat information of `..', chdir to `..',
+ Find the directory entry in '..' that matches the dev/i-node of DOT_SB.
+ Upon success, update *DOT_SB with stat information of '..', chdir to '..',
and prepend "/basename" to FILE_NAME.
Otherwise, exit with a diagnostic.
- PARENT_HEIGHT is the number of levels `..' is above the starting directory.
+ PARENT_HEIGHT is the number of levels '..' is above the starting directory.
The first time this function is called (from the initial directory),
PARENT_HEIGHT is 1. This is solely for diagnostics.
Exit nonzero upon error. */
the information the caller would require in order to produce good
diagnostics, it doesn't seem worth the added complexity.
In any case, any getcwd replacement must *not* exceed the PATH_MAX
- limitation. Otherwise, functions like `chdir' would fail with
+ limitation. Otherwise, functions like 'chdir' would fail with
ENAMETOOLONG.
FIXME-maybe: if find_dir_entry fails due to permissions, try getcwd,
#include "areadlink.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "readlink"
#define AUTHORS proper_name ("Dmitry V. Levin")
#include "error.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "realpath"
#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady")
the implementation choices [#4 and #5 were suggested by Paul Eggert]:
1) call openat with O_WRONLY|O_NOCTTY
Disadvantage: may create the file and doesn't work for directory,
- may mistakenly report `unwritable' for EROFS or ACLs even though
+ may mistakenly report 'unwritable' for EROFS or ACLs even though
perm bits say the file is writable.
2) fake eaccessat (save_cwd, fchdir, call euidaccess, restore_cwd)
IS_DIR is true if ENT designates a directory, false otherwise.
- Depending on MODE, ask whether to `descend into' or to `remove' the
+ Depending on MODE, ask whether to `descend into' or to 'remove' the
directory FILENAME. MODE is ignored when FILENAME is not a directory.
Set *IS_EMPTY_P to T_YES if FILENAME is an empty directory, and it is
appropriate to try to remove it with rmdir (e.g. recursive mode).
-/* `rm' file deletion utility for GNU.
+/* 'rm' file deletion utility for GNU.
Copyright (C) 1988, 1990-1991, 1994-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
#include "yesno.h"
#include "priv-set.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "rm"
#define AUTHORS \
ARGMATCH_VERIFY (interactive_args, interactive_types);
/* Advise the user about invalid usages like "rm -foo" if the file
- "-foo" exists, assuming ARGC and ARGV are as with `main'. */
+ "-foo" exists, assuming ARGC and ARGV are as with 'main'. */
static void
diagnose_leading_hyphen (int argc, char **argv)
x->stdin_tty = isatty (STDIN_FILENO);
x->verbose = false;
- /* Since this program exits immediately after calling `rm', rm need not
+ /* Since this program exits immediately after calling 'rm', rm need not
expend unnecessary effort to preserve the initial working directory. */
x->require_restore_cwd = false;
}
#include "prog-fprintf.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "rmdir"
#define AUTHORS proper_name ("David MacKenzie")
static struct option const longopts[] =
{
- /* Don't name this `--force' because it's not close enough in meaning
+ /* Don't name this '--force' because it's not close enough in meaning
to e.g. rm's -f option. */
{"ignore-fail-on-non-empty", no_argument, NULL,
IGNORE_FAIL_ON_NON_EMPTY_OPTION},
#include "quote.h"
#include "quotearg.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "runcon"
#define AUTHORS proper_name ("Russell Coker")
# define isfinite(x) ((x) * 0 == 0)
#endif
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "seq"
#define AUTHORS proper_name ("Ulrich Drepper")
* drastically bad if told to attack a named pipe or socket?
*/
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "shred"
#define AUTHORS proper_name ("Colin Plumb")
#include "stdio--.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "shuf"
#define AUTHORS proper_name ("Paul Eggert")
#include "xnanosleep.h"
#include "xstrtod.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "sleep"
#define AUTHORS \
/* Given a floating point value *X, and a suffix character, SUFFIX_CHAR,
scale *X by the multiplier implied by SUFFIX_CHAR. SUFFIX_CHAR may
- be the NUL byte or `s' to denote seconds, `m' for minutes, `h' for
- hours, or `d' for days. If SUFFIX_CHAR is invalid, don't modify *X
+ be the NUL byte or 's' to denote seconds, 'm' for minutes, 'h' for
+ hours, or 'd' for days. If SUFFIX_CHAR is invalid, don't modify *X
and return false. Otherwise return true. */
static bool
# define getrlimit(Resource, Rlp) (-1)
#endif
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "sort"
#define AUTHORS \
/* FIXME: None of these tables work with multibyte character sets.
Also, there are many other bugs when handling multibyte characters.
- One way to fix this is to rewrite `sort' to use wide characters
+ One way to fix this is to rewrite 'sort' to use wide characters
internally, but doing this with good performance is a bit
tricky. */
whichever comes first. If there are more than EWORD fields, leave
PTR pointing at the beginning of the field having zero-based index,
EWORD. If a delimiter character was specified (via -t), then that
- `beginning' is the first character following the delimiting TAB.
- Otherwise, leave PTR pointing at the first `blank' character after
+ 'beginning' is the first character following the delimiting TAB.
+ Otherwise, leave PTR pointing at the first 'blank' character after
the preceding field. */
if (tab != TAB_DEFAULT)
while (ptr < lim && eword--)
Date: Thu, 30 May 96 12:20:41 -0400
[Translated to POSIX 1003.1-2001 terminology by Paul Eggert.]
- [...]I believe I've found another bug in `sort'.
+ [...]I believe I've found another bug in 'sort'.
$ cat /tmp/sort.in
a b c 2 d
{
if (nlines == 2)
{
- /* Declare `swap' as int, not bool, to work around a bug
+ /* Declare 'swap' as int, not bool, to work around a bug
<http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html>
in the IBM xlc 6.0.0.0 compiler in 64-bit mode. */
int swap = (0 < compare (&lines[-1], &lines[-2]));
quote (files[i]));
else if (files[i][0] == '\0')
{
- /* Using the standard `filename:line-number:' prefix here is
+ /* Using the standard 'filename:line-number:' prefix here is
not totally appropriate, since NUL is the separator,
not NL, but it might be better than nothing. */
unsigned long int file_number = i + 1;
#include "xfreopen.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "split"
#define AUTHORS \
}
/* Compute the next sequential output file name and store it into the
- string `outfile'. */
+ string 'outfile'. */
static void
next_file_name (void)
#if ! _POSIX_NO_TRUNC && HAVE_PATHCONF && defined _PC_NAME_MAX
/* POSIX requires that if the output file name is too long for
- its directory, `split' must fail without creating any files.
+ its directory, 'split' must fail without creating any files.
This must be checked for explicitly on operating systems that
silently truncate file names. */
{
{
bool fail = false;
- /* Add 2 to accommodate our conversion of the stat `%s' format string
- to the longer printf `%llu' one. */
+ /* Add 2 to accommodate our conversion of the stat '%s' format string
+ to the longer printf '%llu' one. */
enum
{
MAX_ADDITIONAL_BYTES =
#include "xstrtol.h"
#include "c-ctype.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "stdbuf"
#define LIB_NAME "libstdbuf.so" /* FIXME: don't hardcode */
#include "quote.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "stty"
#define AUTHORS proper_name ("David MacKenzie")
# define CSWTCH _POSIX_VDISABLE
#endif
-/* SunOS 5.3 loses (^Z doesn't work) if `swtch' is the same as `susp'.
- So the default is to disable `swtch.' */
+/* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'.
+ So the default is to disable 'swtch.' */
#if defined __sparc__ && defined __svr4__
# undef CSWTCH
# define CSWTCH _POSIX_VDISABLE
};
/* Flags for `struct mode_info'. */
-#define SANE_SET 1 /* Set in `sane' mode. */
-#define SANE_UNSET 2 /* Unset in `sane' mode. */
-#define REV 4 /* Can be turned off by prepending `-'. */
+#define SANE_SET 1 /* Set in 'sane' mode. */
+#define SANE_UNSET 2 /* Unset in 'sane' mode. */
+#define REV 4 /* Can be turned off by prepending '-'. */
#define OMIT 8 /* Don't display value. */
/* Each mode. */
/* POSIX (according to Zlotnick's book) tcsetattr returns zero if
it performs *any* of the requested operations. This means it
- can report `success' when it has actually failed to perform
+ can report 'success' when it has actually failed to perform
some proper subset of the requested operations. To detect
this partial failure, get the current terminal attributes and
compare them to the requested ones. */
error (EXIT_FAILURE, errno, "%s", device_name);
/* Normally, one shouldn't use memcmp to compare structures that
- may have `holes' containing uninitialized data, but we have been
+ may have 'holes' containing uninitialized data, but we have been
careful to initialize the storage of these two variables to all
zeroes. One might think it more efficient simply to compare the
modified fields, but that would require enumerating those fields --
}
/* Return a string that is the printable representation of character CH. */
-/* Adapted from `cat' by Torbjorn Granlund. */
+/* Adapted from 'cat' by Torbjorn Granlund. */
static const char *
visible (cc_t ch)
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Run a shell with the real and effective UID and GID and groups
- of USER, default `root'.
+ of USER, default 'root'.
The shell run is taken from USER's password entry, /bin/sh if
none is specified there. If the account has a password, su
prompts for a password unless run by a user with real UID 0.
Does not change the current directory.
- Sets `HOME' and `SHELL' from the password entry for USER, and if
- USER is not root, sets `USER' and `LOGNAME' to USER.
+ Sets 'HOME' and 'SHELL' from the password entry for USER, and if
+ USER is not root, sets 'USER' and 'LOGNAME' to USER.
The subshell is not a login shell.
If one or more ARGs are given, they are passed as additional
#include "error.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "su"
#define AUTHORS proper_name ("David MacKenzie")
static void run_shell (char const *, char const *, char **, size_t)
ATTRIBUTE_NORETURN;
-/* If true, pass the `-f' option to the subshell. */
+/* If true, pass the '-f' option to the subshell. */
static bool fast_startup;
/* If true, simulate a login instead of just starting a shell. */
return STREQ (encrypted, correct);
}
-/* Update `environ' for the new shell based on PW, with SHELL being
+/* Update 'environ' for the new shell based on PW, with SHELL being
the value for the SHELL environment variable. */
static void
#include "safe-read.h"
#include "xfreopen.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "sum"
#define AUTHORS \
#include "error.h"
#include "long-options.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "sync"
#define AUTHORS proper_name ("Jim Meyering")
#include "stdlib--.h"
#include "xfreopen.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tac"
#define AUTHORS \
/* True if we have ever read standard input. */
static bool have_read_stdin = false;
-/* If true, print `separator' along with the record preceding it
+/* If true, print 'separator' along with the record preceding it
in the file; otherwise with the record following it. */
static bool separator_ends_record;
-/* 0 if `separator' is to be matched as a regular expression;
- otherwise, the length of `separator', used as a sentinel to
+/* 0 if 'separator' is to be matched as a regular expression;
+ otherwise, the length of 'separator', used as a sentinel to
stop the search. */
static size_t sentinel_length;
-/* The length of a match with `separator'. If `sentinel_length' is 0,
- `match_length' is computed every time a match succeeds;
- otherwise, it is simply the length of `separator'. */
+/* The length of a match with 'separator'. If 'sentinel_length' is 0,
+ 'match_length' is computed every time a match succeeds;
+ otherwise, it is simply the length of 'separator'. */
static size_t match_length;
/* The input buffer. */
static char *G_buffer;
-/* The number of bytes to read at once into `buffer'. */
+/* The number of bytes to read at once into 'buffer'. */
static size_t read_size;
-/* The size of `buffer'. This is read_size * 2 + sentinel_length + 2.
- The extra 2 bytes allow `past_end' to have a value beyond the
- end of `G_buffer' and `match_start' to run off the front of `G_buffer'. */
+/* The size of 'buffer'. This is read_size * 2 + sentinel_length + 2.
+ The extra 2 bytes allow 'past_end' to have a value beyond the
+ end of 'G_buffer' and 'match_start' to run off the front of 'G_buffer'. */
static size_t G_buffer_size;
-/* The compiled regular expression representing `separator'. */
+/* The compiled regular expression representing 'separator'. */
static struct re_pattern_buffer compiled_separator;
static char compiled_separator_fastmap[UCHAR_MAX + 1];
static struct re_registers regs;
static bool
tac_seekable (int input_fd, const char *file)
{
- /* Pointer to the location in `G_buffer' where the search for
+ /* Pointer to the location in 'G_buffer' where the search for
the next separator will begin. */
char *match_start;
- /* Pointer to one past the rightmost character in `G_buffer' that
+ /* Pointer to one past the rightmost character in 'G_buffer' that
has not been printed yet. */
char *past_end;
- /* Length of the record growing in `G_buffer'. */
+ /* Length of the record growing in 'G_buffer'. */
size_t saved_record_size;
/* Offset in the file of the next read. */
off_t file_pos;
- /* True if `output' has not been called yet for any file.
+ /* True if 'output' has not been called yet for any file.
Only used when the separator is attached to the preceding record. */
bool first_time = true;
char first_char = *separator; /* Speed optimization, non-regexp. */
return true; /* It's an empty file. */
/* Arrange for the first read to lop off enough to leave the rest of the
- file a multiple of `read_size'. Since `read_size' can change, this may
+ file a multiple of 'read_size'. Since 'read_size' can change, this may
not always hold during the program run, but since it usually will, leave
it here for i/o efficiency (page/sector boundaries and all that).
Note: the efficiency gain has not been verified. */
if (saved_record_size == 0)
saved_record_size = read_size;
file_pos -= saved_record_size;
- /* `file_pos' now points to the start of the last (probably partial) block
+ /* 'file_pos' now points to the start of the last (probably partial) block
in the input file. */
if (lseek (input_fd, file_pos, SEEK_SET) < 0)
while (true)
{
- /* Search backward from `match_start' - 1 to `G_buffer' for a match
- with `separator'; for speed, use strncmp if `separator' contains no
+ /* Search backward from 'match_start' - 1 to 'G_buffer' for a match
+ with 'separator'; for speed, use strncmp if 'separator' contains no
metacharacters.
- If the match succeeds, set `match_start' to point to the start of
- the match and `match_length' to the length of the match.
- Otherwise, make `match_start' < `G_buffer'. */
+ If the match succeeds, set 'match_start' to point to the start of
+ the match and 'match_length' to the length of the match.
+ Otherwise, make 'match_start' < 'G_buffer'. */
if (sentinel_length == 0)
{
size_t i = match_start - G_buffer;
}
else
{
- /* `match_length' is constant for non-regexp boundaries. */
+ /* 'match_length' is constant for non-regexp boundaries. */
while (*--match_start != first_char
|| (match_length1 && strncmp (match_start + 1, separator1,
match_length1)))
/* Do nothing. */ ;
}
- /* Check whether we backed off the front of `G_buffer' without finding
- a match for `separator'. */
+ /* Check whether we backed off the front of 'G_buffer' without finding
+ a match for 'separator'. */
if (match_start < G_buffer)
{
if (file_pos == 0)
saved_record_size = past_end - G_buffer;
if (saved_record_size > read_size)
{
- /* `G_buffer_size' is about twice `read_size', so since
- we want to read in another `read_size' bytes before
- the data already in `G_buffer', we need to increase
- `G_buffer_size'. */
+ /* 'G_buffer_size' is about twice 'read_size', so since
+ we want to read in another 'read_size' bytes before
+ the data already in 'G_buffer', we need to increase
+ 'G_buffer_size'. */
char *newbuffer;
size_t offset = sentinel_length ? sentinel_length : 1;
ptrdiff_t match_start_offset = match_start - G_buffer;
}
else
{
- /* Found a match of `separator'. */
+ /* Found a match of 'separator'. */
if (separator_ends_record)
{
char *match_end = match_start + match_length;
- /* If this match of `separator' isn't at the end of the
+ /* If this match of 'separator' isn't at the end of the
file, print the record. */
if (!first_time || match_end != past_end)
output (match_end, past_end);
#if HAVE_INOTIFY
# include "hash.h"
# include <sys/inotify.h>
-/* `select' is used by tail_forever_inotify. */
+/* 'select' is used by tail_forever_inotify. */
# include <sys/select.h>
/* inotify needs to know if a file is local. */
# endif
#endif
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tail"
#define AUTHORS \
}
/* Print the last N_LINES lines from the end of file FD.
- Go backward through the file, reading `BUFSIZ' bytes at a time (except
+ Go backward through the file, reading 'BUFSIZ' bytes at a time (except
probably the first), until we hit the start of the file or have
read NUMBER newlines.
START_POS is the starting position of the read pointer for the file
if (n_lines == 0)
return true;
- /* Set `bytes_read' to the size of the last, probably partial, buffer;
- 0 < `bytes_read' <= `BUFSIZ'. */
+ /* Set 'bytes_read' to the size of the last, probably partial, buffer;
+ 0 < 'bytes_read' <= 'BUFSIZ'. */
bytes_read = (pos - start_pos) % BUFSIZ;
if (bytes_read == 0)
bytes_read = BUFSIZ;
- /* Make `pos' a multiple of `BUFSIZ' (0 if the file is short), so that all
+ /* Make 'pos' a multiple of 'BUFSIZ' (0 if the file is short), so that all
reads will be on block boundaries, which might increase efficiency. */
pos -= bytes_read;
xlseek (fd, pos, SEEK_SET, pretty_filename);
total_lines += tmp->nlines;
/* If there is enough room in the last buffer read, just append the new
- one to it. This is because when reading from a pipe, `n_read' can
+ one to it. This is because when reading from a pipe, 'n_read' can
often be very small. */
if (tmp->nbytes + last->nbytes < BUFSIZ)
{
char const *buffer_end = tmp->buffer + tmp->nbytes;
if (total_lines > n_lines)
{
- /* Skip `total_lines' - `n_lines' newlines. We made sure that
- `total_lines' - `n_lines' <= `tmp->nlines'. */
+ /* Skip 'total_lines' - 'n_lines' newlines. We made sure that
+ 'total_lines' - 'n_lines' <= 'tmp->nlines'. */
size_t j;
for (j = total_lines - n_lines; j; --j)
{
total_bytes += tmp->nbytes;
/* If there is enough room in the last buffer read, just append the new
- one to it. This is because when reading from a pipe, `nbytes' can
+ one to it. This is because when reading from a pipe, 'nbytes' can
often be very small. */
if (tmp->nbytes + last->nbytes < BUFSIZ)
{
total_bytes -= tmp->nbytes;
/* Find the correct beginning, then print the rest of the file.
- We made sure that `total_bytes' - `n_bytes' <= `tmp->nbytes'. */
+ We made sure that 'total_bytes' - 'n_bytes' <= 'tmp->nbytes'. */
if (total_bytes > n_bytes)
i = total_bytes - n_bytes;
else
return spec1->wd == spec2->wd;
}
-/* Helper function used by `tail_forever_inotify'. */
+/* Helper function used by 'tail_forever_inotify'. */
static void
check_fspec (struct File_spec *fspec, int wd, int *prev_wd)
{
/* Wait for inotify events and handle them. Events on directories
ensure that watched files can be re-added when following by name.
- This loop blocks on the `safe_read' call until a new event is notified.
+ This loop blocks on the 'safe_read' call until a new event is notified.
But when --pid=P is specified, tail usually waits via the select. */
while (1)
{
fspec = &(f[j]);
- /* Remove `fspec' and re-add it using `new_fd' as its key. */
+ /* Remove 'fspec' and re-add it using 'new_fd' as its key. */
hash_delete (wd_to_name, fspec);
fspec->wd = new_wd;
struct stat stats;
#if TEST_RACE_BETWEEN_FINAL_READ_AND_INITIAL_FSTAT
- /* Before the tail function provided `read_pos', there was
+ /* Before the tail function provided 'read_pos', there was
a race condition described in the URL below. This sleep
call made the window big enough to exercise the problem. */
xnanosleep (1);
if (found_hyphen && follow_mode == Follow_name)
error (EXIT_FAILURE, 0, _("cannot follow %s by name"), quote ("-"));
- /* When following forever, warn if any file is `-'.
+ /* When following forever, warn if any file is '-'.
This is only a warning, since tail's output (before a failing seek,
and that from any non-stdin files) might still be useful. */
if (forever && found_hyphen && isatty (STDIN_FILENO))
#include "stdio--.h"
#include "xfreopen.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tee"
#define AUTHORS \
descriptors = xnmalloc (nfiles + 1, sizeof *descriptors);
- /* Move all the names `up' one in the argv array to make room for
+ /* Move all the names 'up' one in the argv array to make room for
the entry for standard output. This writes into argv[argc]. */
for (i = nfiles; i >= 1; i--)
files[i] = files[i - 1];
# define LBRACKET 0
#endif
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#if LBRACKET
# define PROGRAM_NAME "["
#else
bool value;
bool negated = false;
- /* Deal with leading `not's. */
+ /* Deal with leading 'not's. */
while (pos < argc && argv[pos][0] == '!' && argv[pos][1] == '\0')
{
advance (true);
/* Given a floating point value *X, and a suffix character, SUFFIX_CHAR,
scale *X by the multiplier implied by SUFFIX_CHAR. SUFFIX_CHAR may
- be the NUL byte or `s' to denote seconds, `m' for minutes, `h' for
- hours, or `d' for days. If SUFFIX_CHAR is invalid, don't modify *X
+ be the NUL byte or 's' to denote seconds, 'm' for minutes, 'h' for
+ hours, or 'd' for days. If SUFFIX_CHAR is invalid, don't modify *X
and return false. Otherwise return true. */
static bool
#include "stat-time.h"
#include "utimens.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "touch"
#define AUTHORS \
proper_name ("David MacKenzie"), \
proper_name ("Randy Smith")
-/* Bitmasks for `change_times'. */
+/* Bitmasks for 'change_times'. */
#define CH_ATIME 1
#define CH_MTIME 2
{NULL, 0, NULL, 0}
};
-/* Valid arguments to the `--time' option. */
+/* Valid arguments to the '--time' option. */
static char const* const time_args[] =
{
"atime", "access", "use", "mtime", "modify", NULL
};
-/* The bits in `change_times' that those arguments set. */
+/* The bits in 'change_times' that those arguments set. */
static int const time_masks[] =
{
CH_ATIME, CH_ATIME, CH_ATIME, CH_MTIME, CH_MTIME
}
}
- /* The obsolete `MMDDhhmm[YY]' form is valid IFF there are
+ /* The obsolete 'MMDDhhmm[YY]' form is valid IFF there are
two or more non-option arguments. */
if (!date_set && 2 <= argc - optind && posix2_version () < 200112
&& posixtime (&newtime[0].tv_sec, argv[optind],
#include "xfreopen.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tr"
#define AUTHORS proper_name ("Jim Meyering")
For example, consider the POSIX version of the classic tr command:
tr -cs 'a-zA-Z_' '[\n*]'
String1 has 3 constructs, two of which are ranges (a-z and A-Z),
- and a single normal character, `_'. String2 has one construct. */
+ and a single normal character, '_'. String2 has one construct. */
struct List_element
{
enum Range_element_type type;
the corresponding argument string. The attributes are used mainly
to verify that the strings are valid in the context of any options
specified (like -s, -d, or -c). The main exception is the member
- `tail', which is first used to construct the list. After construction,
+ 'tail', which is first used to construct the list. After construction,
it is used by get_next to save its state when traversing the list.
- The member `state' serves a similar function. */
+ The member 'state' serves a similar function. */
struct Spec_list
{
/* Points to the head of the list of range elements.
"lower", "print", "punct", "space", "upper", "xdigit"
};
-/* Array of boolean values. A character `c' is a member of the
+/* Array of boolean values. A character 'c' is a member of the
squeeze set if and only if in_squeeze_set[c] is true. The squeeze
set is defined by the last (possibly, the only) string argument
on the command line when the squeeze option is given. */
static bool in_squeeze_set[N_CHARS];
-/* Array of boolean values. A character `c' is a member of the
+/* Array of boolean values. A character 'c' is a member of the
delete set if and only if in_delete_set[c] is true. The delete
set is defined by the first (or only) string argument on the
command line when the delete option is given. */
beginning with P[ START_IDX ] comprise a valid [c*n] construct,
then set *CHAR_TO_REPEAT, *REPEAT_COUNT, and *CLOSING_BRACKET_IDX
and return zero. If the second character following
- the opening bracket is not `*' or if no closing bracket can be
+ the opening bracket is not '*' or if no closing bracket can be
found, return -1. If a closing bracket is found and the
- second char is `*', but the string between the `*' and `]' isn't
+ second char is '*', but the string between the '*' and ']' isn't
empty, an octal number, or a decimal number, print an error message
and return -2. */
else
{
/* Here, we have found [c*s] where s should be a string
- of octal (if it starts with `0') or decimal digits. */
+ of octal (if it starts with '0') or decimal digits. */
char const *digit_str = &es->s[start_idx + 2];
char *d_end;
if ((xstrtoumax (digit_str, &d_end, *digit_str == '0' ? 8 : 10,
}
/* Return true if the string at ES->s[IDX] matches the regular
- expression `\*[0-9]*\]', false otherwise. The string does not
+ expression '\*[0-9]*\]', false otherwise. The string does not
match if any of its characters are escaped. */
static bool _GL_ATTRIBUTE_PURE
/* Convert string UNESCAPED_STRING (which has been preprocessed to
convert backslash-escape sequences) of length LEN characters into
a linked list of the following 5 types of constructs:
- - [:str:] Character class where `str' is one of the 12 valid strings.
- - [=c=] Equivalence class where `c' is any single character.
- - [c*n] Repeat the single character `c' `n' times. n may be omitted.
- However, if `n' is present, it must be a non-negative octal or
+ - [:str:] Character class where 'str' is one of the 12 valid strings.
+ - [=c=] Equivalence class where 'c' is any single character.
+ - [c*n] Repeat the single character 'c' 'n' times. n may be omitted.
+ However, if 'n' is present, it must be a non-negative octal or
decimal integer.
- - r-s Range of characters from `r' to `s'. The second endpoint must
+ - r-s Range of characters from 'r' to 's'. The second endpoint must
not precede the first in the current collating sequence.
- c Any other character is interpreted as itself. */
/* The main for-loop below recognizes the 4 multi-character constructs.
A character that matches (in its context) none of the multi-character
- constructs is classified as `normal'. Since all multi-character
+ constructs is classified as 'normal'. Since all multi-character
constructs have at least 3 characters, any strings of length 2 or
less are composed solely of normal characters. Hence, the index of
the outer for-loop runs only as far as LEN-2. */
continue;
/* We reach this point if P does not match [:str:], [=c=],
- [c*n], or [c*]. Now, see if P looks like a range `[-c'
- (from `[' to `c'). */
+ [c*n], or [c*]. Now, see if P looks like a range '[-c'
+ (from '[' to 'c'). */
}
/* Look ahead one char for ranges like a-z. */
}
/* Given a Spec_list S (with its saved state implicit in the values
- of its members `tail' and `state'), return the next single character
+ of its members 'tail' and 'state'), return the next single character
in the expansion of S's constructs. If the last character of S was
returned on the previous call or if S was empty, this function
returns -1. For example, successive calls to get_next where S
/* Read at most SIZE bytes from stdin into the array BUF. Then
perform the in-place and one-to-one mapping specified by the global
- array `xlate'. Return the number of characters read, or 0 upon EOF. */
+ array 'xlate'. Return the number of characters read, or 0 upon EOF. */
static size_t
read_and_xlate (char *buf, size_t size)
/* Initialize a boolean membership set, IN_SET, with the character
values obtained by traversing the linked list of constructs S
- using the function `get_next'. IN_SET is expected to have been
+ using the function 'get_next'. IN_SET is expected to have been
initialized to all zeros by the caller. If COMPLEMENT_THIS_SET
is true the resulting set is complemented. */
validate (s1, s2);
- /* Use binary I/O, since `tr' is sometimes used to transliterate
+ /* Use binary I/O, since 'tr' is sometimes used to transliterate
non-printable characters, or characters which are stripped away
by text-mode reads (like CR and ^Z). */
if (O_BINARY && ! isatty (STDIN_FILENO))
#include "stat-size.h"
#include "xstrtol.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "truncate"
#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady")
#include "readtokens.h"
#include "stdio--.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tsort"
#define AUTHORS proper_name ("Mark Kettenis")
/* The head of the sorted list. */
static struct item *head = NULL;
-/* The tail of the list of `zeros', strings that have no predecessors. */
+/* The tail of the list of 'zeros', strings that have no predecessors. */
static struct item *zeros = NULL;
/* Used for loop detection. */
TTY_WRITE_ERROR = 3
};
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "tty"
#define AUTHORS proper_name ("David MacKenzie")
#include "quote.h"
#include "uname.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME (uname_mode == UNAME_UNAME ? "uname" : "arch")
#define AUTHORS proper_name ("David MacKenzie")
#define ARCH_AUTHORS "David MacKenzie", "Karel Zak"
-/* Values that are bitwise or'd into `toprint'. */
+/* Values that are bitwise or'd into 'toprint'. */
/* Kernel name. */
#define PRINT_KERNEL_NAME 1
#include "quote.h"
#include "xstrndup.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "unexpand"
#define AUTHORS proper_name ("David MacKenzie")
read on the line. */
static bool convert_entire_line;
-/* If nonzero, the size of all tab stops. If zero, use `tab_list' instead. */
+/* If nonzero, the size of all tab stops. If zero, use 'tab_list' instead. */
static size_t tab_size;
/* The maximum distance between tab stops. */
static size_t max_column_width;
/* Array of the explicit column numbers of the tab stops;
- after `tab_list' is exhausted, the rest of the line is printed
+ after 'tab_list' is exhausted, the rest of the line is printed
unchanged. The first column is column 0. */
static uintmax_t *tab_list;
-/* The number of allocated entries in `tab_list'. */
+/* The number of allocated entries in 'tab_list'. */
static size_t n_tabs_allocated;
-/* The index of the first invalid element of `tab_list',
+/* The index of the first invalid element of 'tab_list',
where the next element can be added. */
static size_t first_free_tab;
/* Null-terminated array of input filenames. */
static char **file_list;
-/* Default for `file_list' if no files are given on the command line. */
+/* Default for 'file_list' if no files are given on the command line. */
static char *stdin_argv[] =
{
(char *) "-", NULL
exit (status);
}
-/* Add tab stop TABVAL to the end of `tab_list'. */
+/* Add tab stop TABVAL to the end of 'tab_list'. */
static void
add_tab_stop (uintmax_t tabval)
/* Close the old stream pointer FP if it is non-NULL,
and return a new one opened to read the next input file.
- Open a filename of `-' as the standard input.
+ Open a filename of '-' as the standard input.
Return NULL if there are no more input files. */
static FILE *
}
/* Change blanks to tabs, writing to stdout.
- Read each file in `file_list', in order. */
+ Read each file in 'file_list', in order. */
static void
unexpand (void)
#include "xstrtol.h"
#include "memcasecmp.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "uniq"
#define AUTHORS \
initbuffer (thisline);
initbuffer (prevline);
- /* The duplication in the following `if' and `else' blocks is an
+ /* The duplication in the following 'if' and 'else' blocks is an
optimization to distinguish the common case (in which none of
the following options has been specified: --count, -repeated,
--all-repeated, --unique) from the others. In the common case,
#include "long-options.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "unlink"
#define AUTHORS proper_name ("Michael Stone")
#include "readutmp.h"
#include "fprintftime.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "uptime"
#define AUTHORS \
#include "quote.h"
#include "readutmp.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "users"
#define AUTHORS \
((wc) == to_uchar (wc) && isspace (to_uchar (wc)))
#endif
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "wc"
#define AUTHORS \
fdadvise (fd, 0, 0, FADVISE_SEQUENTIAL);
/* When counting only bytes, save some line- and word-counting
- overhead. If FD is a `regular' Unix file, using lseek is enough
- to get its `size' in bytes. Otherwise, read blocks of BUFFER_SIZE
- bytes at a time until EOF. Note that the `size' (number of bytes)
+ overhead. If FD is a 'regular' Unix file, using lseek is enough
+ to get its 'size' in bytes. Otherwise, read blocks of BUFFER_SIZE
+ bytes at a time until EOF. Note that the 'size' (number of bytes)
that wc reports is smaller than stats.st_size when the file is not
positioned at its beginning. That's why the lseek calls below are
necessary. For example the command
`(dd ibs=99k skip=1 count=0; ./wc -c) < /etc/group'
- should make wc report `0' bytes. */
+ should make wc report '0' bytes. */
if (count_bytes && !count_chars && !print_lines && !count_complicated)
{
/* Back-up the state before each multibyte character conversion and
move the last incomplete character of the buffer to the front
of the buffer. This is needed because we don't know whether
- the `mbrtowc' function updates the state when it returns -2, -
+ the 'mbrtowc' function updates the state when it returns -2, -
this is the ISO C 99 and glibc-2.2 behaviour - or not - amended
ANSI C, glibc-2.1 and Solaris 5.7 behaviour. We don't have an
autoconf test for this, yet. */
error (0, 0, "%s", _("invalid zero-length file name"));
else
{
- /* Using the standard `filename:line-number:' prefix here is
+ /* Using the standard 'filename:line-number:' prefix here is
not totally appropriate, since NUL is the separator, not NL,
but it might be better than nothing. */
unsigned long int file_number = argv_iter_n_args (ai);
# include <grp.h>
#endif
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "who"
#define AUTHORS \
/* If true, display a line at the top describing each field. */
static bool include_heading;
-/* If true, display a `+' for each user if mesg y, a `-' if mesg n,
- or a `?' if their tty cannot be statted. */
+/* If true, display a '+' for each user if mesg y, a '-' if mesg n,
+ or a '?' if their tty cannot be statted. */
static bool include_mesg;
/* If true, display process termination & exit status. */
char line[sizeof (utmp_ent->ut_line) + DEV_DIR_LEN + 1];
PIDSTR_DECL_AND_INIT (pidstr, utmp_ent);
- /* Copy ut_line into LINE, prepending `/dev/' if ut_line is not
+ /* Copy ut_line into LINE, prepending '/dev/' if ut_line is not
already an absolute file name. Some systems may put the full,
absolute file name in ut_line. */
if (utmp_ent->ut_line[0] == '/')
#include "long-options.h"
#include "quote.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "whoami"
#define AUTHORS proper_name ("Richard Mlynarik")
#include "error.h"
#include "long-options.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "yes"
#define AUTHORS proper_name ("David MacKenzie")