ldd.1, execve.2, getdents.2, quotactl.2, select_tut.2, clock_getcpuclockid.3, fopencookie.3, getservent_r.3, matherr.3, mq_notify.3, pthread_create.3, pthread_getattr_np.3, wordexp.3: Global fix: s/-/\\-/ when real hyphen is required (e.g., in code)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2012-08-29 12:04:28 +02:00
parent 352c778d01
commit 72da9ef157
13 changed files with 28 additions and 28 deletions

View File

@ -43,7 +43,7 @@ on an untrusted executable,
since this may result in the execution of arbitrary code.
A safer alternative when dealing with untrusted executables is:
$ objdump -p /path/to/program | grep NEEDED
$ objdump \-p /path/to/program | grep NEEDED
.SH OPTIONS
.TP
.B \-\-version

View File

@ -567,7 +567,7 @@ main(int argc, char *argv[])
char *newenviron[] = { NULL };
if (argc != 2) {
fprintf(stderr, "Usage: %s <file-to-exec>\\n", argv[0]);
fprintf(stderr, "Usage: %s <file\-to\-exec>\\n", argv[0]);
exit(EXIT_FAILURE);
}

View File

@ -254,12 +254,12 @@ main(int argc, char *argv[])
if (nread == 0)
break;
printf("\--------------- nread=%d ---------------\\n", nread);
printf("\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- nread=%d \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\\n", nread);
printf("i\-node# file type d_reclen d_off d_name\\n");
for (bpos = 0; bpos < nread;) {
d = (struct linux_dirent *) (buf + bpos);
printf("%8ld ", d\->d_ino);
d_type = *(buf + bpos + d\->d_reclen - 1);
d_type = *(buf + bpos + d\->d_reclen \- 1);
printf("%\-10s ", (d_type == DT_REG) ? "regular" :
(d_type == DT_DIR) ? "directory" :
(d_type == DT_FIFO) ? "FIFO" :
@ -268,7 +268,7 @@ main(int argc, char *argv[])
(d_type == DT_BLK) ? "block dev" :
(d_type == DT_CHR) ? "char dev" : "???");
printf("%4d %10lld %s\\n", d\->d_reclen,
(long long) d\->d_off, d->d_name);
(long long) d\->d_off, d\->d_name);
bpos += d\->d_reclen;
}
}

View File

@ -140,8 +140,8 @@ as follows:
.in +4n
.nf
/* uint64_t is an unsigned 64-bit integer;
uint32_t is an unsigned 32-bit integer */
/* uint64_t is an unsigned 64\-bit integer;
uint32_t is an unsigned 32-\bit integer */
struct dqblk { /* Definition since Linux 2.4.22 */
uint64_t dqb_bhardlimit; /* absolute limit on disk
@ -227,8 +227,8 @@ as follows:
.in +4n
.nf
/* uint64_t is an unsigned 64-bit integer;
uint32_t is an unsigned 32-bit integer */
/* uint64_t is an unsigned 64\-bit integer;
uint32_t is an unsigned 32\-bit integer */
struct dqinfo { /* Defined since kernel 2.4.22 */
uint64_t dqi_bgrace; /* Time before block soft limit

View File

@ -638,8 +638,8 @@ main(int argc, char *argv[])
int buf2_avail, buf2_written;
if (argc != 4) {
fprintf(stderr, "Usage\\n\\tfwd <listen-port> "
"<forward-to-port> <forward-to-ip-address>\\n");
fprintf(stderr, "Usage\\n\\tfwd <listen\-port> "
"<forward\-to\-port> <forward\-to\-ip\-address>\\n");
exit(EXIT_FAILURE);
}

View File

@ -125,7 +125,7 @@ main(int argc, char *argv[])
struct timespec ts;
if (argc != 2) {
fprintf(stderr, "%s <process-ID>\\n", argv[0]);
fprintf(stderr, "%s <process\-ID>\\n", argv[0]);
exit(EXIT_FAILURE);
}

View File

@ -293,8 +293,8 @@ memfile_write(void *c, const char *buf, size_t size)
/* Buffer too small? Keep doubling size until big enough */
while (size + cookie\->offset > cookie->allocated) {
new_buff = realloc(cookie\->buf, cookie->allocated * 2);
while (size + cookie\->offset > cookie\->allocated) {
new_buff = realloc(cookie\->buf, cookie\->allocated * 2);
if (new_buff == NULL) {
return \-1;
} else {
@ -303,11 +303,11 @@ memfile_write(void *c, const char *buf, size_t size)
}
}
memcpy(cookie\->buf + cookie->offset, buf, size);
memcpy(cookie\->buf + cookie\->offset, buf, size);
cookie\->offset += size;
if (cookie\->offset > cookie->endpos)
cookie\->endpos = cookie->offset;
if (cookie\->offset > cookie\->endpos)
cookie\->endpos = cookie\->offset;
return size;
}
@ -321,12 +321,12 @@ memfile_read(void *c, char *buf, size_t size)
/* Fetch minimum of bytes requested and bytes available */
xbytes = size;
if (cookie\->offset + size > cookie->endpos)
xbytes = cookie\->endpos - cookie->offset;
if (cookie\->offset + size > cookie\->endpos)
xbytes = cookie\->endpos \- cookie\->offset;
if (xbytes < 0) /* offset may be past endpos */
xbytes = 0;
memcpy(buf, cookie\->buf + cookie->offset, xbytes);
memcpy(buf, cookie\->buf + cookie\->offset, xbytes);
cookie\->offset += xbytes;
return xbytes;

View File

@ -179,7 +179,7 @@ main(int argc, char *argv[])
char **p;
if (argc < 3) {
printf("Usage: %s port\-num proto-name [buflen]\\n", argv[0]);
printf("Usage: %s port\-num proto\-name [buflen]\\n", argv[0]);
exit(EXIT_FAILURE);
}

View File

@ -382,7 +382,7 @@ matherr(struct exception *exc)
(exc\->type == PLOSS) ? "PLOSS" : "???",
exc\->name);
fprintf(stderr, " args: %f, %f\\n",
exc\->arg1, exc->arg2);
exc\->arg1, exc\->arg2);
fprintf(stderr, " retval: %f\\n", exc\->retval);
if (change_retval)
@ -398,7 +398,7 @@ main(int argc, char *argv[])
if (argc < 2) {
fprintf(stderr, "Usage: %s <argval>"
" [<matherr\-ret> [<new\-func-retval>]]\\n", argv[0]);
" [<matherr\-ret> [<new\-func\-retval>]]\\n", argv[0]);
exit(EXIT_FAILURE);
}

View File

@ -222,7 +222,7 @@ main(int argc, char *argv[])
struct sigevent sev;
if (argc != 2) {
fprintf(stderr, "Usage: %s <mq-name>\\n", argv[0]);
fprintf(stderr, "Usage: %s <mq\-name>\\n", argv[0]);
exit(EXIT_FAILURE);
}

View File

@ -269,7 +269,7 @@ thread_start(void *arg)
char *uargv, *p;
printf("Thread %d: top of stack near %p; argv_string=%s\\n",
tinfo\->thread_num, &p, tinfo->argv_string);
tinfo\->thread_num, &p, tinfo\->argv_string);
uargv = strdup(tinfo\->argv_string);
if (uargv == NULL)

View File

@ -241,8 +241,8 @@ usage(char *pname, char *msg)
{
if (msg != NULL)
fputs(msg, stderr);
fprintf(stderr, "Usage: %s [\-s stack-size [\-a]]"
" [\-g guard-size]\\n", pname);
fprintf(stderr, "Usage: %s [\-s stack\-size [\-a]]"
" [\-g guard\-size]\\n", pname);
fprintf(stderr, "\\t\\t\-a means program should allocate stack\\n");
exit(EXIT_FAILURE);
}

View File

@ -201,7 +201,7 @@ main(int argc, char **argv)
char **w;
int i;
wordexp("[a-c]*.c", &p, 0);
wordexp("[a\-c]*.c", &p, 0);
w = p.we_wordv;
for (i = 0; i < p.we_wordc; i++)
printf("%s\en", w[i]);