=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/admin.c,v retrieving revision 1.46 retrieving revision 1.47 diff -c -r1.46 -r1.47 *** src/usr.bin/cvs/admin.c 2007/01/25 18:56:33 1.46 --- src/usr.bin/cvs/admin.c 2007/02/01 09:45:43 1.47 *************** *** 1,8 **** ! /* $OpenBSD: admin.c,v 1.46 2007/01/25 18:56:33 otto Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * Copyright (c) 2005 Joris Vink ! * Copyright (c) 2006 Xavier Santolaria * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above --- 1,8 ---- ! /* $OpenBSD: admin.c,v 1.47 2007/02/01 09:45:43 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * Copyright (c) 2005 Joris Vink ! * Copyright (c) 2006, 2007 Xavier Santolaria * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above *************** *** 43,49 **** static int runflags = 0; static int lkmode = RCS_LOCK_INVAL; ! static char *alist, *comment, *elist, *logmsg, *logstr; static char *oldfilename, *orange, *state, *statestr; static RCSNUM *logrev; --- 43,50 ---- static int runflags = 0; static int lkmode = RCS_LOCK_INVAL; ! static int kflag = RCS_KWEXP_DEFAULT; ! static char *alist, *comment, *elist, *logmsg, *logstr, *koptstr; static char *oldfilename, *orange, *state, *statestr; static RCSNUM *logrev; *************** *** 79,84 **** --- 80,92 ---- case 'I': break; case 'k': + koptstr = optarg; + kflag = rcs_kflag_get(koptstr); + if (RCS_KWEXP_INVAL(kflag)) { + cvs_log(LP_ERR, + "invalid RCS keyword expension mode"); + fatal("%s", cvs_cmd_admin.cmd_synopsis); + } break; case 'L': if (lkmode == RCS_LOCK_LOOSE) { *************** *** 147,152 **** --- 155,163 ---- cvs_client_send_request("Argument -e%s", (elist != NULL) ? elist : ""); + if (koptstr != NULL) + cvs_client_send_request("Argument -k%s", koptstr); + if (lkmode == RCS_LOCK_STRICT) cvs_client_send_request("Argument -L"); else if (lkmode == RCS_LOCK_LOOSE) *************** *** 280,285 **** --- 291,303 ---- } /* no synced anymore */ cf->file_rcs->rf_flags &= ~RCS_SYNCED; + } + + /* Default `-kv' is accepted here. */ + if (koptstr != NULL) { + if (cf->file_rcs->rf_expand == NULL || + strcmp(cf->file_rcs->rf_expand, koptstr) != 0) + rcs_kwexp_set(cf->file_rcs, kflag); } if (logstr != NULL) {