aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-05-23 14:48:05 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-05-23 14:48:05 +0000
commitaa134866ad3127753d521cc9aca28a226d941aa4 (patch)
tree88868947cf42cf5dbb2fcd120a862bffb347b6e5
parent4a59246031483629d4bbbb326c510f30e82ba86b (diff)
downloadsrc-aa134866ad3127753d521cc9aca28a226d941aa4.tar.gz
src-aa134866ad3127753d521cc9aca28a226d941aa4.zip
Import a slightly newer version of 1.9.9 (as at 970523) that has fixed a
few more memory leaks and cleaned up getopt usage. These were done shortly after the last one I imported. Very little has changed other than that. (except for some doc updates) Obtained from: cyclic.com
Notes
Notes: svn path=/vendor/cvs/dist/; revision=26065
-rw-r--r--contrib/cvs/BUGS10
-rw-r--r--contrib/cvs/ChangeLog8
-rw-r--r--contrib/cvs/contrib/ChangeLog7
-rw-r--r--contrib/cvs/contrib/listen2.c42
-rw-r--r--contrib/cvs/contrib/listen2.mak47
-rw-r--r--contrib/cvs/doc/ChangeLog42
-rw-r--r--contrib/cvs/doc/RCSFILES17
-rw-r--r--contrib/cvs/doc/cvs.texinfo138
-rw-r--r--contrib/cvs/src/ChangeLog36
-rw-r--r--contrib/cvs/src/add.c2
-rw-r--r--contrib/cvs/src/checkout.c2
-rw-r--r--contrib/cvs/src/commit.c2
-rw-r--r--contrib/cvs/src/cvsrc.c20
-rw-r--r--contrib/cvs/src/diff.c2
-rw-r--r--contrib/cvs/src/edit.c8
-rw-r--r--contrib/cvs/src/history.c2
-rw-r--r--contrib/cvs/src/import.c2
-rw-r--r--contrib/cvs/src/log.c2
-rw-r--r--contrib/cvs/src/logmsg.c2
-rw-r--r--contrib/cvs/src/main.c37
-rw-r--r--contrib/cvs/src/modules.c37
-rw-r--r--contrib/cvs/src/parseinfo.c7
-rw-r--r--contrib/cvs/src/patch.c2
-rw-r--r--contrib/cvs/src/rcs.c2
-rw-r--r--contrib/cvs/src/recurse.c4
-rw-r--r--contrib/cvs/src/release.c2
-rw-r--r--contrib/cvs/src/remove.c2
-rw-r--r--contrib/cvs/src/rtag.c2
-rw-r--r--contrib/cvs/src/status.c2
-rw-r--r--contrib/cvs/src/subr.c6
-rw-r--r--contrib/cvs/src/tag.c2
-rw-r--r--contrib/cvs/src/update.c2
-rw-r--r--contrib/cvs/src/watch.c4
33 files changed, 427 insertions, 75 deletions
diff --git a/contrib/cvs/BUGS b/contrib/cvs/BUGS
index 2a1c8602a74c..6f482b6a6045 100644
--- a/contrib/cvs/BUGS
+++ b/contrib/cvs/BUGS
@@ -15,6 +15,16 @@ similar file for the unix-like operating systems (not yet, at least).
This file also might contain some platform-specific bugs.
+* Exporting binary files on non-unix clients with "cvs export" does
+not work. The workaround is to use "cvs checkout" instead. If you
+are thinking of fixing this, check out the comment "For cvs export,
+assume it is a text file." in client.c.
+
+
+* Wrappers do not work client/server, and there are a variety of other
+bugs and annoyances with wrappers.
+
+
* Some people have reported seeing the message "dying gasps from %s
unexpected" (where %s is the name of your server) when using
client/server CVS. One person reported that this had to do with using
diff --git a/contrib/cvs/ChangeLog b/contrib/cvs/ChangeLog
index 6c4565b4e7e3..4009d133373b 100644
--- a/contrib/cvs/ChangeLog
+++ b/contrib/cvs/ChangeLog
@@ -1,3 +1,11 @@
+Wed May 21 17:02:29 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * BUGS: Add item about wrappers.
+
+Fri May 16 13:43:53 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * BUGS: Add item about "cvs export" and binary files.
+
Sun May 11 11:38:03 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* README.VMS: Remove information about "direct TCP". Noone has
diff --git a/contrib/cvs/contrib/ChangeLog b/contrib/cvs/contrib/ChangeLog
index 3fbee6196a2c..0c45efae9236 100644
--- a/contrib/cvs/contrib/ChangeLog
+++ b/contrib/cvs/contrib/ChangeLog
@@ -1,3 +1,10 @@
+17 May 1997 Jim Kingdon
+
+ * listen2.c: Failed attempt at making this do what it was
+ intended to do. Will need to rethink the approach.
+ * listen2.mak: The usual involuntary tweaks.
+ * .cvsignore: Add listen2.ncb listen2.mdp.
+
Mon May 12 11:59:23 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* listener.c: Removed; see ../ChangeLog for rationale.
diff --git a/contrib/cvs/contrib/listen2.c b/contrib/cvs/contrib/listen2.c
index 09226bda88e6..20cfc6cd4556 100644
--- a/contrib/cvs/contrib/listen2.c
+++ b/contrib/cvs/contrib/listen2.c
@@ -5,6 +5,8 @@
#include <winsock.h>
#include <stdio.h>
+#include <io.h>
+#include <process.h>
int
main ()
@@ -42,12 +44,51 @@ main ()
while (1)
{
int sasize = sizeof (sa);
+
+#if 0
+ int save_stdin, save_stdout;
+#endif
+
s = accept (t, (struct sockaddr *) &sa, &sasize);
if (s == INVALID_SOCKET)
{
printf ("Cannot accept(): %d\n", WSAGetLastError ());
exit (1);
}
+#if 0
+ /* This, of course, does not work because sockets are
+ not file descriptors and file descriptors are not
+ sockets. Duh! */
+ save_stdin = _dup (0);
+ if (save_stdin < 0)
+ {
+ printf ("Cannot save stdin: %s\n", strerror (errno));
+ exit (1);
+ }
+ save_stdout = _dup (1);
+ if (save_stdout < 0)
+ {
+ printf ("Cannot save stdout: %s\n", strerror (errno));
+ exit (1);
+ }
+ if (_dup2 (s, 0) < 0)
+ {
+ printf ("Cannot dup stdin: %s\n", strerror (errno));
+ exit (1);
+ }
+ if (_dup2 (s, 1) < 0)
+ {
+ printf ("Cannot dup stdout: %s\n", strerror (errno));
+ exit (1);
+ }
+ /* Of course this will be "cvs" eventually, but "netstat"
+ is for testing. */
+ if (_spawnl (_P_DETACH, "netstat", "netstat", NULL) < 0)
+ {
+ printf ("Cannot spawn subprocess: %s\n", strerror (errno));
+ exit (1);
+ }
+#else
if (send (s, "hello, world\n", 13, 0) == SOCKET_ERROR)
{
/* Note that we do not detect the case in which we sent
@@ -55,6 +96,7 @@ main ()
printf ("Cannot send(): %d\n", WSAGetLastError ());
exit (1);
}
+#endif
if (closesocket (s) != 0)
{
printf ("Cannot closesocket(): %d\n", WSAGetLastError ());
diff --git a/contrib/cvs/contrib/listen2.mak b/contrib/cvs/contrib/listen2.mak
index a72fd08779ed..12a80cede84e 100644
--- a/contrib/cvs/contrib/listen2.mak
+++ b/contrib/cvs/contrib/listen2.mak
@@ -49,10 +49,11 @@ CPP=cl.exe
OUTDIR=.\Release
INTDIR=.\Release
-ALL :
+ALL : "$(OUTDIR)\listen2.exe"
CLEAN :
- -@erase
+ -@erase ".\Release\listen2.exe"
+ -@erase ".\Release\listen2.obj"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -72,12 +73,18 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)/listen2.bsc"
BSC32_SBRS=
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib /nologo /subsystem:console /machine:I386
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
- advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib /nologo\
/subsystem:console /incremental:no /pdb:"$(OUTDIR)/listen2.pdb" /machine:I386\
/out:"$(OUTDIR)/listen2.exe"
-LINK32_OBJS=
+LINK32_OBJS= \
+ "$(INTDIR)/listen2.obj"
+
+"$(OUTDIR)\listen2.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
!ELSEIF "$(CFG)" == "listen2 - Win32 Debug"
@@ -94,10 +101,15 @@ LINK32_OBJS=
OUTDIR=.\Debug
INTDIR=.\Debug
-ALL :
+ALL : "$(OUTDIR)\listen2.exe"
CLEAN :
- -@erase
+ -@erase ".\Debug\listen2.exe"
+ -@erase ".\Debug\listen2.obj"
+ -@erase ".\Debug\listen2.ilk"
+ -@erase ".\Debug\listen2.pdb"
+ -@erase ".\Debug\vc40.pdb"
+ -@erase ".\Debug\vc40.idb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
@@ -117,12 +129,18 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)/listen2.bsc"
BSC32_SBRS=
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
- advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib /nologo\
/subsystem:console /incremental:yes /pdb:"$(OUTDIR)/listen2.pdb" /debug\
/machine:I386 /out:"$(OUTDIR)/listen2.exe"
-LINK32_OBJS=
+LINK32_OBJS= \
+ "$(INTDIR)/listen2.obj"
+
+"$(OUTDIR)\listen2.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
!ENDIF
@@ -156,6 +174,15 @@ LINK32_OBJS=
!ENDIF
+################################################################################
+# Begin Source File
+
+SOURCE=.\listen2.c
+
+"$(INTDIR)\listen2.obj" : $(SOURCE) "$(INTDIR)"
+
+
+# End Source File
# End Target
# End Project
################################################################################
diff --git a/contrib/cvs/doc/ChangeLog b/contrib/cvs/doc/ChangeLog
index 1ef10f4784bd..a8cb3e20d383 100644
--- a/contrib/cvs/doc/ChangeLog
+++ b/contrib/cvs/doc/ChangeLog
@@ -1,3 +1,45 @@
+Thu May 22 09:25:56 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Error messages): Add comment about yet another way
+ to produce a "cannot open CVS/Entries for reading" error.
+
+Tue May 20 17:54:55 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Error messages): Add item about EINVAL in rename.
+
+Mon May 19 00:21:49 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvs.texinfo (Keywords in imports): New node.
+ (Tracking sources): Add comment about what a "vendor" is.
+
+ * cvs.texinfo (Keyword substitution): Where it refers to RCS
+ having a certain behavior, rewrite to not pass the buck like
+ that. Saying "RCS file" is still OK; that is a legit CVS
+ concept. A few other minor edits.
+
+Sun May 18 10:24:57 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * RCSFILES: Add list of known newphrase extensions.
+
+ * cvs.texinfo (From other version control systems): Fix typo
+ ("systesm" -> "systems").
+
+ * cvs.texinfo (Exit status): New node.
+ (diff): Replace text on exit status with an xref to that node.
+ The previous text documented a behavior which CVS no longer
+ implements.
+ (user-defined logging, commitinfo, verifymsg, Error messages):
+ Add index entries for "exit status, of <something which CVS invokes>".
+
+ * cvs.texinfo (Administrative files): Add comment concerning
+ writing triggers and particularly performance issues.
+
+ * cvs.texinfo (rtag options, tag options): Don't discuss what old
+ versions did with respect to the behavior now controlled by -F; we
+ don't try to document old versions here. Add comments concerning
+ how -F should be documented. Add index entries for "renaming
+ tags" and such pointing to "tag -F".
+
Wed May 14 12:16:19 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
* cvs.texinfo (Binary files): Add text and comment about
diff --git a/contrib/cvs/doc/RCSFILES b/contrib/cvs/doc/RCSFILES
index 41d131bbcfce..90a023fcb73c 100644
--- a/contrib/cvs/doc/RCSFILES
+++ b/contrib/cvs/doc/RCSFILES
@@ -37,6 +37,23 @@ for more information on them. CVS also sets the RCS state to "dead"
to indicate that a file does not exist in a given revision (this is
stored just as any other RCS state is).
+The RCS file format allows quite a variety of extensions to be added
+in a compatible manner by use of the "newphrase" feature documented in
+rcsfile.5. We won't try to document extensions not used by CVS in any
+detail, but we will briefly list them. Each occurrence of a newphrase
+begins with an identifier, which is what we list here. Future
+designers of extensions are strongly encouraged to pick
+non-conflicting identifiers. Note that newphrase occurs several
+places in the RCS grammar, and a given extension may not be legal in
+all locations. However, it seems better to reserve a particular
+identifier for all locations, to avoid confusion and complicated
+rules.
+
+ Identifier Used by
+ ---------- -------
+ namespace RCS library done at Silicon Graphics Inc. (SGI) in 1996
+ (a modified RCS 5.7--not sure it has any other name).
+
The rules regarding keyword expansion are not documented along with
the rest of the RCS file format; they are documented in the co(1)
manpage in the RCS 5.7 distribution. See also the "Keyword
diff --git a/contrib/cvs/doc/cvs.texinfo b/contrib/cvs/doc/cvs.texinfo
index 633098474ef7..43f66065db7c 100644
--- a/contrib/cvs/doc/cvs.texinfo
+++ b/contrib/cvs/doc/cvs.texinfo
@@ -2494,7 +2494,7 @@ files are binary and which are not. @xref{Wrappers}.
@c thinking of something more concise.
@node From other version control systems
@subsection Creating Files From Other Version Control Systems
-@cindex Importing files, from other version control systesm
+@cindex Importing files, from other version control systems
If you have a project which you are maintaining with
another version control system, such as @sc{rcs}, you
@@ -4896,6 +4896,15 @@ are checking out contains any files in that directory.
@cindex Tracking sources
@c FIXME: Need discussion of added and removed files.
+@c FIXME: This doesn't really adequately introduce the
+@c concepts of "vendor" and "you". They don't *have*
+@c to be separate organizations or separate people.
+@c We want a description which is somewhat more based on
+@c the technical issues of which sources go where, but
+@c also with enough examples of how this relates to
+@c relationships like customer-supplier, developer-QA,
+@c maintainer-contributor, or whatever, to make it
+@c seem concrete.
If you modify a program to better fit your site, you
probably want to include your modifications when the next
release of the program arrives. @sc{cvs} can help you with
@@ -4928,6 +4937,7 @@ revision.
* Update imports:: Updating a module with the import command
* Reverting local changes:: Reverting a module to the latest vendor release
* Binary files in imports:: Binary files require special handling
+* Keywords in imports:: Keyword substitution might be undesirable
@end menu
@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -5048,6 +5058,33 @@ after the @samp{-b}. @xref{admin options}.
Use the @samp{-k} wrapper option to tell import which
files are binary. @xref{Wrappers}.
+@node Keywords in imports
+@section How to handle keyword substitution with cvs import
+
+The sources which you are importing may contain
+keywords (@pxref{Keyword substitution}). For example,
+the vendor may use @sc{cvs} or some other system
+which uses similar keyword expansion syntax. If you
+just import the files in the default fashion, then
+the keyword expansions supplied by the vendor will
+be replaced by keyword expansions supplied by your
+own copy of @sc{cvs}. It may be more convenient to
+maintain the expansions supplied by the vendor, so
+that this information can supply information about
+the sources that you imported from the vendor.
+
+To maintain the keyword expansions supplied by the
+vendor, supply the @samp{-ko} option to @code{cvs
+import} the first time you import the file.
+This will turn off keyword expansion
+for that file entirely, so if you want to be more
+selective you'll have to think about what you want
+and use the @samp{-k} option to @code{cvs update} or
+@code{cvs admin} as appropriate.
+@c Supplying -ko to import if the file already existed
+@c has no effect. Not clear to me whether it should
+@c or not.
+
@c ---------------------------------------------------------------------
@node Moving files
@chapter Moving and renaming files
@@ -5468,6 +5505,7 @@ Notified}); this command is useful even if you are not
using @code{cvs watch on}.
@cindex taginfo
+@cindex exit status, of taginfo
The @file{taginfo} file defines programs to execute
when someone executes a @code{tag} or @code{rtag}
command. The @file{taginfo} file has the standard form
@@ -5540,7 +5578,7 @@ But as soon as you export the files from your
development environment it becomes harder to identify
which revisions they are.
-@sc{Rcs} uses a mechanism known as @dfn{keyword
+CVS can use a mechanism known as @dfn{keyword
substitution} (or @dfn{keyword expansion}) to help
identifying the files. Embedded strings of the form
@code{$@var{keyword}$} and
@@ -5550,7 +5588,7 @@ with strings of the form
a new revision of the file.
@menu
-* Keyword list:: RCS Keywords
+* Keyword list:: Keywords
* Using keywords:: Using keywords
* Avoiding substitution:: Avoiding substitution
* Substitution modes:: Substitution modes
@@ -5562,8 +5600,13 @@ a new revision of the file.
@section RCS Keywords
@cindex RCS keywords
-This is a list of the keywords that @sc{rcs} currently
-(in release 5.6.0.1) supports:
+@c FIXME: need some kind of example here I think,
+@c perhaps in a
+@c "Keyword intro" node. The intro in the "Keyword
+@c substitution" node itself seems OK, but to launch
+@c into a list of the keywords somehow seems too abrupt.
+
+This is a list of the keywords:
@table @code
@cindex Author keyword
@@ -5711,7 +5754,7 @@ keyword substitution. You can use @samp{-ko}
(@pxref{Substitution modes}) to turn off keyword
substitution entirely.
-In many cases you can avoid using @sc{rcs} keywords in
+In many cases you can avoid using keywords in
the source, even though they appear in the final
product. For example, the source for this manual
contains @samp{$@@asis@{@}Author$} whenever the text
@@ -5722,7 +5765,7 @@ and @code{troff} you can embed the null-character
@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@node Substitution modes
@section Substitution modes
-@cindex -k (RCS kflags)
+@cindex -k (keyword substitution)
@cindex Kflag
@c FIXME: This could be made more coherent, by expanding it
@@ -5805,10 +5848,14 @@ keyword---just do a @code{cvs log}. Once you export
the file the history information might be useless
anyhow.
-A more serious concern is that @sc{rcs} is not good at
+A more serious concern is that @sc{cvs} is not good at
handling @code{$@asis{}Log$} entries when a branch is
merged onto the main trunk. Conflicts often result
from the merging operation.
+@c We say "cvs" even though it is done via rcsmerge;
+@c this is an implementation detail. If the merging is
+@c done in CVS instead, should check if this problem
+@c still persists.
People also tend to "fix" the log entries in the file
(correcting spelling mistakes and maybe even factual
@@ -6160,6 +6207,7 @@ reference to @sc{cvs} commands, @pxref{Invoking CVS}).
@menu
* Structure:: Overall structure of CVS commands
+* Exit status:: Indicating CVS's success or failure
* ~/.cvsrc:: Default options with the ~/.csvrc file
* Global options:: Options you give to the left of cvs_command
* Common options:: Options you give to the right of cvs_command
@@ -6224,6 +6272,40 @@ is accepted by more commands. In other words, do not
take the above categorization too seriously. Look at
the documentation instead.
+@node Exit status
+@appendixsec CVS's exit status
+@cindex exit status, of CVS
+
+CVS can indicate to the calling environment whether it
+succeeded or failed by setting its @dfn{exit status}.
+The exact way of testing the exit status will vary from
+one operating system to another. For example in a unix
+shell script the @samp{$?} variable will be 0 if the
+last command returned a successful exit status, or
+greater than 0 if the exit status indicated failure.
+
+If CVS is successful, it returns a successful status;
+if there is an error, it prints an error message and
+returns a failure status. The one exception to this is
+the @code{cvs diff} command. It will return a
+successful status if it found no differences, or a
+failure status if there were differences or if there
+was an error. Because this behavior provides no good
+way to detect errors, in the future it is possible that
+@code{cvs diff} will be changed to behave like the
+other @sc{cvs} commands.
+@c It might seem like checking whether cvs -q diff
+@c produces empty or non-empty output can tell whether
+@c there were differences or not. But it seems like
+@c there are cases with output but no differences
+@c (testsuite basica-8b). It is not clear to me how
+@c useful it is for a script to be able to check
+@c whether there were differences.
+@c FIXCVS? In previous versions of CVS, cvs diff
+@c returned 0 for no differences, 1 for differences, or
+@c 2 for errors. Is this behavior worth trying to
+@c bring back (but what does it mean for VMS?)?
+
@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@node ~/.cvsrc
@appendixsec Default options and the ~/.cvsrc file
@@ -7482,9 +7564,8 @@ If any file names are given, only those files are
compared. If any directories are given, all files
under them will be compared.
-The exit status will be 0 if no differences were found,
-1 if some differences were found, and 2 if any error
-occurred.
+The exit status for diff is different than for other
+@sc{cvs} commands; for details @ref{Exit status}.
@menu
* diff options:: diff options
@@ -8555,8 +8636,15 @@ recent revision (instead of ignoring the file).
@item -F
Overwrite an existing tag of the same name on a
-different revision. This option is new in @sc{cvs}
-1.4. The old behavior is matched by @samp{cvs tag -F}.
+different revision.
+@c FIXME: Needs an example, and/or more explanation.
+@c Also needs to contrast this with the behavior if -F
+@c is not specified, and the description needs to be
+@c moved somewhere where it is shared between "tag" and
+@c "rtag" (probably some sub-node of Revisions and
+@c branches). Also should be clear about whether this
+@c applies to branch tags, non-branch tags, or both.
+@c Also this is *not* a common option.
@item -l
Local; run only in current working directory.
@@ -8673,10 +8761,13 @@ These standard options are supported by @code{tag}
them):
@table @code
+@cindex renaming tags
+@cindex tags, renaming
+@cindex moving tags
@item -F
Overwrite an existing tag of the same name on a
-different revision. This option is new in @sc{cvs}
-1.4. The old behavior is matched by @samp{cvs tag -F}.
+different revision.
+@c FIXME: See "rtag -F" for comments on this.
@item -l
Local; run only in current working directory.
@@ -9651,6 +9742,13 @@ behavior}.
@cindex Reference manual (files)
@cindex CVSROOT (file)
+@c FIXME? Somewhere there needs to be a more "how-to"
+@c guide to writing these. I think the triggers
+@c (commitinfo, loginfo, taginfo, &c) are perhaps a
+@c different case than files like modules. One
+@c particular issue that people sometimes are
+@c (unnecessarily?) worried about is performance, and
+@c the impact of writing in perl or sh or ____.
Inside the repository, in the directory
@file{$CVSROOT/CVSROOT}, there are a number of
supportive files for @sc{cvs}. You can use @sc{cvs} in a limited
@@ -10114,6 +10212,7 @@ repository is appended to the template, followed by the
file names of any files involved in the commit (added,
removed, and modified files).
+@cindex exit status, of commitinfo
The first line with a regular expression matching the
relative path to the module will be used. If the
command returns a non-zero exit status the commit will
@@ -10184,6 +10283,7 @@ If the repository name does not match any of the
regular expressions in this file, the @samp{DEFAULT}
line is used, if it is specified.
+@cindex exit status, of verifymsg
If the verification script exits with a non-zero exit status,
the commit is aborted.
@@ -11015,6 +11115,7 @@ produced it should work fine.
@c For one example see basica-1a10 in the testsuite
@c For another example, "cvs co ." on NT; see comment
@c at windows-NT/filesubr.c (expand_wild).
+@c For another example, "cvs co foo/bar" where foo exists.
@item cannot open CVS/Entries for reading: No such file or directory
This generally indicates a @sc{cvs} internal error, and
can be handled as with other @sc{cvs} bugs
@@ -11022,6 +11123,12 @@ can be handled as with other @sc{cvs} bugs
exact nature of which would depend on the situation but
which hopefully could be figured out.
+@item cvs [checkout aborted]: cannot rename file @var{file} to CVS/,,@var{file}: Invalid argument
+This message has been reported as intermittently
+happening with CVS 1.9 on Solaris 2.5. The cause is
+unknown; if you know more about what causes it, let us
+know as described in @ref{BUGS}.
+
@item cvs [update aborted]: could not patch @var{file}: No such file or directory
This means that there was a problem finding the
@code{patch} program. Make sure that it is in your
@@ -11119,6 +11226,7 @@ it might be sufficient to place GNU diff3 in your
@c Should we mention the cvsaux binaries here?
@item cvs commit: warning: editor session failed
+@cindex exit status, of editor
This means that the editor which @sc{cvs} is using exits with a nonzero
exit status. Some versions of vi will do this even when there was not
a problem editing the file. If so, point the
diff --git a/contrib/cvs/src/ChangeLog b/contrib/cvs/src/ChangeLog
index e1d4dc07caca..5f4f43e1f9db 100644
--- a/contrib/cvs/src/ChangeLog
+++ b/contrib/cvs/src/ChangeLog
@@ -1,5 +1,41 @@
+Fri May 16 13:14:30 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * subr.c (free_names): Update documentation to reflect fact that
+ free_names is now called to free vectors allocated by expand_wild
+ as well as by line2argv.
+
+ * main.c (main): Use "xstrdup (foo)" not "xstrdup(foo)" as
+ specified in HACKING.
+
+Fri May 16 15:10:37 1997 Norbert Kiesel <nk@cosa.de>
+
+ * modules.c (do_module): initialize optind to 0. use local copies
+ of optarg's (because they might me freed within free_names).
+
Thu May 15 11:50:15 1997 Norbert Kiesel <nk@cosa.de>
+ * main.c (main): initialize optind to 0. use local copies of
+ optarg's (because they might me freed within read_cvsrc).
+
+ * cvsrc.c (read_cvsrc): free old argv after constructing a new
+ one. This fixes a memory leak.
+
+ * recurse.c (start_recursion): use free_names() instead of
+ reimplementing it
+
+ * rcs.c (RCS_deltas): free branchversion (memory leak).
+
+ * parseinfo.c (Parse_Info): free some vars (3 memory leaks).
+
+ * logmsg.c (logfile_write): free str_list_format (memory leak).
+
+ * watch.c (watch_addremove), (watchers), update.c (update), tag.c
+ (cvstag), status.c (status), rtag.c (rtag), remove.c (cvsremove),
+ release.c (release), patch.c (patch), log.c (cvslog), import.c
+ (import), history.c (history), edit.c (watch_onoff), (edit),
+ (unedit), (editors), diff.c (diff), commit.c (commit), checkout.c
+ (checkout), add.c (add): initialize optind to 0
+
* diff.c (diff_fileproc): cosmetic change (whitespace added).
* checkout.c (checkout): move local variable definition into the
diff --git a/contrib/cvs/src/add.c b/contrib/cvs/src/add.c
index b7d5e5d7335c..92209306b561 100644
--- a/contrib/cvs/src/add.c
+++ b/contrib/cvs/src/add.c
@@ -102,7 +102,7 @@ add (argc, argv)
wrap_setup ();
/* parse args */
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+k:m:")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/checkout.c b/contrib/cvs/src/checkout.c
index 5074fe460542..82096012cd93 100644
--- a/contrib/cvs/src/checkout.c
+++ b/contrib/cvs/src/checkout.c
@@ -135,7 +135,7 @@ checkout (argc, argv)
ign_setup ();
wrap_setup ();
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, valid_options)) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/commit.c b/contrib/cvs/src/commit.c
index c0c35975d696..c43e35f35383 100644
--- a/contrib/cvs/src/commit.c
+++ b/contrib/cvs/src/commit.c
@@ -332,7 +332,7 @@ commit (argc, argv)
}
#endif /* CVS_BADROOT */
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+nlRm:fF:r:")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/cvsrc.c b/contrib/cvs/src/cvsrc.c
index 819013ce51c5..5e9cfa504a91 100644
--- a/contrib/cvs/src/cvsrc.c
+++ b/contrib/cvs/src/cvsrc.c
@@ -51,6 +51,13 @@ read_cvsrc (argc, argv, cmdname)
int max_new_argv;
char **new_argv;
+ /* old_argc and old_argv hold the values returned from the
+ previous invocation of read_cvsrc and are used to free the
+ allocated memory. The first invocation of read_cvsrc gets argv
+ from the system, this memory must not be free'd. */
+ static int old_argc = 0;
+ static char **old_argv = NULL;
+
/* don't do anything if argc is -1, since that implies "help" mode */
if (*argc == -1)
return;
@@ -134,11 +141,18 @@ read_cvsrc (argc, argv, cmdname)
}
for (i=1; i < *argc; i++)
{
- new_argv [new_argc++] = (*argv)[i];
+ new_argv [new_argc++] = xstrdup ((*argv)[i]);
+ }
+
+ if (old_argv != NULL)
+ {
+ /* Free the memory which was allocated in the previous
+ read_cvsrc call. */
+ free_names (&old_argc, old_argv);
}
- *argc = new_argc;
- *argv = new_argv;
+ old_argc = *argc = new_argc;
+ old_argv = *argv = new_argv;
free (homeinit);
return;
diff --git a/contrib/cvs/src/diff.c b/contrib/cvs/src/diff.c
index 8253a2ff691f..608a00f4d0f9 100644
--- a/contrib/cvs/src/diff.c
+++ b/contrib/cvs/src/diff.c
@@ -199,7 +199,7 @@ diff (argc, argv)
}
opts[0] = '\0';
- optind = 1;
+ optind = 0;
while ((c = getopt_long (argc, argv,
"+abcdefhilnpstuwy0123456789BHNRTC:D:F:I:L:U:V:W:k:r:",
longopts, &option_index)) != -1)
diff --git a/contrib/cvs/src/edit.c b/contrib/cvs/src/edit.c
index 8d3bbb165816..33e9c61a7a2b 100644
--- a/contrib/cvs/src/edit.c
+++ b/contrib/cvs/src/edit.c
@@ -60,7 +60,7 @@ watch_onoff (argc, argv)
int local = 0;
int err;
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
@@ -356,7 +356,7 @@ edit (argc, argv)
setting_tedit = 0;
setting_tunedit = 0;
setting_tcommit = 0;
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+lRa:")) != -1)
{
switch (c)
@@ -491,7 +491,7 @@ unedit (argc, argv)
if (argc == -1)
usage (edit_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
@@ -983,7 +983,7 @@ editors (argc, argv)
if (argc == -1)
usage (editors_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/history.c b/contrib/cvs/src/history.c
index 7d28e8102388..ae13409563fb 100644
--- a/contrib/cvs/src/history.c
+++ b/contrib/cvs/src/history.c
@@ -395,7 +395,7 @@ history (argc, argv)
since_tag = xstrdup ("");
backto = xstrdup ("");
rec_types = xstrdup ("");
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+Tacelow?D:b:f:m:n:p:r:t:u:x:X:z:")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/import.c b/contrib/cvs/src/import.c
index a37bd4d213ed..c05fa0df5153 100644
--- a/contrib/cvs/src/import.c
+++ b/contrib/cvs/src/import.c
@@ -80,7 +80,7 @@ import (argc, argv)
wrap_setup ();
vbranch = xstrdup (CVSBRANCH);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+Qqdb:m:I:k:W:")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/log.c b/contrib/cvs/src/log.c
index 8fb6910a2f77..3fd37d4492b6 100644
--- a/contrib/cvs/src/log.c
+++ b/contrib/cvs/src/log.c
@@ -167,7 +167,7 @@ cvslog (argc, argv)
memset (&log_data, 0, sizeof log_data);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+bd:hlNRr::s:tw::")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/logmsg.c b/contrib/cvs/src/logmsg.c
index 98e4ae1ff93c..2655fd9214d2 100644
--- a/contrib/cvs/src/logmsg.c
+++ b/contrib/cvs/src/logmsg.c
@@ -771,6 +771,8 @@ logfile_write (repository, filter, message, logfp, changes)
(void) walklist (changes, title_proc, NULL);
}
+ free (str_list_format);
+
/* Construct the final string. */
srepos = Short_Repository (repository);
diff --git a/contrib/cvs/src/main.c b/contrib/cvs/src/main.c
index 21400eae3e59..fcb80a388ce6 100644
--- a/contrib/cvs/src/main.c
+++ b/contrib/cvs/src/main.c
@@ -329,6 +329,11 @@ main (argc, argv)
const struct cmd *cm;
int c, err = 0;
int rcsbin_update_env, tmpdir_update_env, cvs_update_env;
+ int free_CVSroot = 0;
+ int free_Editor = 0;
+ int free_Tmpdir = 0;
+ int free_Rcsbin = 0;
+
int help = 0; /* Has the user asked for help? This
lets us support the `cvs -H cmd'
convention to give help for cmd. */
@@ -400,11 +405,9 @@ main (argc, argv)
if (getenv (CVSREAD_ENV) != NULL)
cvswrite = FALSE;
- /* I'm not sure whether this needs to be 1 instead of 0 anymore. Using
- 1 used to accomplish what passing "+" as the first character to
- the option string does, but that reason doesn't exist anymore. */
- optind = 1;
-
+ /* Set this to 0 to force getopt initialization. getopt() sets
+ this to 1 internally. */
+ optind = 0;
/* We have to parse the options twice because else there is no
chance to avoid reading the global options from ".cvsrc". Set
@@ -426,7 +429,7 @@ main (argc, argv)
if (use_cvsrc)
read_cvsrc (&argc, &argv, "cvs");
- optind = 1;
+ optind = 0;
opterr = 1;
while ((c = getopt_long
@@ -477,18 +480,22 @@ main (argc, argv)
exit (0);
break;
case 'b':
- Rcsbin = optarg;
+ Rcsbin = xstrdup (optarg);
+ free_Rcsbin = 1;
rcsbin_update_env = 1; /* need to update environment */
break;
case 'T':
- Tmpdir = optarg;
+ Tmpdir = xstrdup (optarg);
+ free_Tmpdir = 1;
tmpdir_update_env = 1; /* need to update environment */
break;
case 'e':
- Editor = optarg;
+ Editor = xstrdup (optarg);
+ free_Editor = 1;
break;
case 'd':
- CVSroot = optarg;
+ CVSroot = xstrdup (optarg);
+ free_CVSroot = 1;
cvs_update_env = 1; /* need to update environment */
break;
case 'H':
@@ -862,6 +869,16 @@ main (argc, argv)
Lock_Cleanup ();
+ free (program_path);
+ if (free_CVSroot)
+ free (CVSroot);
+ if (free_Editor)
+ free (Editor);
+ if (free_Tmpdir)
+ free (Tmpdir);
+ if (free_Rcsbin)
+ free (Rcsbin);
+
#ifdef SYSTEM_CLEANUP
/* Hook for OS-specific behavior, for example socket subsystems on
NT and OS2 or dealing with windows and arguments on Mac. */
diff --git a/contrib/cvs/src/modules.c b/contrib/cvs/src/modules.c
index 7c3d49526986..e01f73385cc9 100644
--- a/contrib/cvs/src/modules.c
+++ b/contrib/cvs/src/modules.c
@@ -445,7 +445,7 @@ do_module (db, mname, m_type, msg, callback_proc, where,
modargv = xmodargv;
/* parse the args */
- optind = 1;
+ optind = 0;
while ((c = getopt (modargc, modargv, CVSMODULE_OPTS)) != -1)
{
switch (c)
@@ -461,7 +461,9 @@ do_module (db, mname, m_type, msg, callback_proc, where,
break;
case 'i':
nonalias_opt = 1;
- checkin_prog = optarg;
+ if (checkin_prog)
+ free (checkin_prog);
+ checkin_prog = xstrdup (optarg);
break;
case 'l':
nonalias_opt = 1;
@@ -469,19 +471,27 @@ do_module (db, mname, m_type, msg, callback_proc, where,
break;
case 'o':
nonalias_opt = 1;
- checkout_prog = optarg;
+ if (checkout_prog)
+ free (checkout_prog);
+ checkout_prog = xstrdup (optarg);
break;
case 'e':
nonalias_opt = 1;
- export_prog = optarg;
+ if (export_prog)
+ free (export_prog);
+ export_prog = xstrdup (optarg);
break;
case 't':
nonalias_opt = 1;
- tag_prog = optarg;
+ if (tag_prog)
+ free (tag_prog);
+ tag_prog = xstrdup (optarg);
break;
case 'u':
nonalias_opt = 1;
- update_prog = optarg;
+ if (update_prog)
+ free (update_prog);
+ update_prog = xstrdup (optarg);
break;
case '?':
error (0, 0,
@@ -535,12 +545,7 @@ do_module (db, mname, m_type, msg, callback_proc, where,
err += callback_proc (&modargc, modargv, where, mwhere, mfile, shorten,
local_specified, mname, msg);
-#if 0
- /* FIXME: I've fixed this so that the correct arguments are called,
- but now this fails because there is code below this point that
- uses optarg values extracted from the arg vector. */
free_names (&xmodargc, xmodargv);
-#endif
/* if there were special include args, process them now */
@@ -718,6 +723,16 @@ do_module (db, mname, m_type, msg, callback_proc, where,
/* clean up */
if (mwhere)
free (mwhere);
+ if (checkin_prog)
+ free (checkin_prog);
+ if (checkout_prog)
+ free (checkout_prog);
+ if (export_prog)
+ free (export_prog);
+ if (tag_prog)
+ free (tag_prog);
+ if (update_prog)
+ free (update_prog);
if (cwd_saved)
free_cwd (&cwd);
if (zvalue != NULL)
diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c
index 1011965835e6..833463ac7d0f 100644
--- a/contrib/cvs/src/parseinfo.c
+++ b/contrib/cvs/src/parseinfo.c
@@ -54,6 +54,7 @@ Parse_Info (infofile, repository, callproc, all)
/* If no file, don't do anything special. */
if (!existence_error (errno))
error (0, errno, "cannot open %s", infopath);
+ free (infopath);
return 0;
}
@@ -105,6 +106,8 @@ Parse_Info (infofile, repository, callproc, all)
if ((cp = strrchr (value, '\n')) != NULL)
*cp = '\0';
+ if (expanded_value != NULL)
+ free (expanded_value);
expanded_value = expand_path (value, infofile, line_number);
if (!expanded_value)
{
@@ -121,6 +124,10 @@ Parse_Info (infofile, repository, callproc, all)
/* save the default value so we have it later if we need it */
if (strcmp (exp, "DEFAULT") == 0)
{
+ /* Is it OK to silently ignore all but the last DEFAULT
+ expression? */
+ if (default_value != NULL)
+ free (default_value);
default_value = xstrdup (expanded_value);
continue;
}
diff --git a/contrib/cvs/src/patch.c b/contrib/cvs/src/patch.c
index 4c2194388dd3..1cf83971ed35 100644
--- a/contrib/cvs/src/patch.c
+++ b/contrib/cvs/src/patch.c
@@ -70,7 +70,7 @@ patch (argc, argv)
if (argc == -1)
usage (patch_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+V:k:cuftsQqlRD:r:")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c
index 15d303ee821c..8be6ea4a612d 100644
--- a/contrib/cvs/src/rcs.c
+++ b/contrib/cvs/src/rcs.c
@@ -4039,6 +4039,8 @@ RCS_deltas (rcs, fp, version, op, text, len, log, loglen)
break;
} while (next != NULL);
+ free (branchversion);
+
if (fclose (fp) < 0)
error (0, errno, "cannot close %s", rcs->path);
diff --git a/contrib/cvs/src/recurse.c b/contrib/cvs/src/recurse.c
index e18d57689d69..b4b55a8efe34 100644
--- a/contrib/cvs/src/recurse.c
+++ b/contrib/cvs/src/recurse.c
@@ -286,9 +286,7 @@ start_recursion (fileproc, filesdoneproc, direntproc, dirleaveproc, callerdat,
err += do_recursion (&frame);
/* Free the data which expand_wild allocated. */
- for (i = 0; i < argc; ++i)
- free (argv[i]);
- free (argv);
+ free_names (&argc, argv);
out:
free (update_dir);
diff --git a/contrib/cvs/src/release.c b/contrib/cvs/src/release.c
index f2f1edf5b0eb..702e90360dc3 100644
--- a/contrib/cvs/src/release.c
+++ b/contrib/cvs/src/release.c
@@ -81,7 +81,7 @@ release (argc, argv)
/* Everything from here on is client or local. */
if (argc == -1)
usage (release_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+Qdq")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/remove.c b/contrib/cvs/src/remove.c
index 157125068fed..46c416938a97 100644
--- a/contrib/cvs/src/remove.c
+++ b/contrib/cvs/src/remove.c
@@ -50,7 +50,7 @@ cvsremove (argc, argv)
if (argc == -1)
usage (remove_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+flR")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/rtag.c b/contrib/cvs/src/rtag.c
index 1e2017b9b0dd..934cd40b2863 100644
--- a/contrib/cvs/src/rtag.c
+++ b/contrib/cvs/src/rtag.c
@@ -91,7 +91,7 @@ rtag (argc, argv)
if (argc == -1)
usage (rtag_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+FanfQqlRdbr:D:")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/status.c b/contrib/cvs/src/status.c
index 67b71beb5658..cdc094936019 100644
--- a/contrib/cvs/src/status.c
+++ b/contrib/cvs/src/status.c
@@ -40,7 +40,7 @@ status (argc, argv)
if (argc == -1)
usage (status_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+vlR")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/subr.c b/contrib/cvs/src/subr.c
index 6a88849bc773..a098123c80bb 100644
--- a/contrib/cvs/src/subr.c
+++ b/contrib/cvs/src/subr.c
@@ -163,9 +163,9 @@ pathname_levels (path)
}
-/*
- * Recover the space allocated by line2argv()
- */
+/* Free a vector, where (*ARGV)[0], (*ARGV)[1], ... (*ARGV)[*PARGC - 1]
+ are malloc'd and so is *ARGV itself. Such a vector is allocated by
+ line2argv or expand_wild, for example. */
void
free_names (pargc, argv)
int *pargc;
diff --git a/contrib/cvs/src/tag.c b/contrib/cvs/src/tag.c
index 9c49da562bbb..93e6c6723fc7 100644
--- a/contrib/cvs/src/tag.c
+++ b/contrib/cvs/src/tag.c
@@ -82,7 +82,7 @@ cvstag (argc, argv)
if (argc == -1)
usage (tag_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+FQqlRcdr:D:bf")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/update.c b/contrib/cvs/src/update.c
index 4b7022a9acdc..1956c6fbca59 100644
--- a/contrib/cvs/src/update.c
+++ b/contrib/cvs/src/update.c
@@ -135,7 +135,7 @@ update (argc, argv)
wrap_setup ();
/* parse the args */
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+ApPflRQqduk:r:D:j:I:W:")) != -1)
{
switch (c)
diff --git a/contrib/cvs/src/watch.c b/contrib/cvs/src/watch.c
index 9bb50d0ed2e4..6cec15736213 100644
--- a/contrib/cvs/src/watch.c
+++ b/contrib/cvs/src/watch.c
@@ -256,7 +256,7 @@ watch_addremove (argc, argv)
the_args.commit = 0;
the_args.edit = 0;
the_args.unedit = 0;
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+lRa:")) != -1)
{
switch (c)
@@ -485,7 +485,7 @@ watchers (argc, argv)
if (argc == -1)
usage (watchers_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)