You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-cvs@tcl.apache.org by he...@apache.org on 2002/02/11 13:46:32 UTC

cvs commit: tcl-websh/src/generic messages.c paramlist.c

hefti       02/02/11 04:46:32

  Modified:    src/generic messages.c paramlist.c
  Log:
  messages.c: proper handling of unicode (see also messages.test)
  paramlist.c: correct error message (see also param.test)
  PR: -
  Obtained from: -
  Submitted by: hefti
  
  Revision  Changes    Path
  1.4       +4 -4      tcl-websh/src/generic/messages.c
  
  Index: messages.c
  ===================================================================
  RCS file: /home/cvs/tcl-websh/src/generic/messages.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- messages.c	25 Oct 2001 17:50:13 -0000	1.3
  +++ messages.c	11 Feb 2002 12:46:32 -0000	1.4
  @@ -9,7 +9,7 @@
    * See the file "license.terms" for information on usage and
    * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    *
  - * @(#) $Id: messages.c,v 1.3 2001/10/25 17:50:13 davidw Exp $
  + * @(#) $Id: messages.c,v 1.4 2002/02/11 12:46:32 hefti Exp $
    *
    */
   
  @@ -98,10 +98,10 @@
       if (Tcl_GetIntFromObj(interp, objv[2], &cmdcode) == TCL_ERROR)
   	return TCL_ERROR;
   
  -    len = Tcl_GetCharLength(objv[3]);
  +    tmpStr = Tcl_GetStringFromObj(objv[3],&len);
  +
  +    if ( send_msg(tc, cmdcode, flags, len, (void *)tmpStr) == -1 ) {
   
  -    if (send_msg(tc, cmdcode, flags, len, (void *) Tcl_GetString(objv[3]))
  -	== -1) {
   	Tcl_PosixError(interp);
   	return TCL_ERROR;
       }
  
  
  
  1.4       +5 -11     tcl-websh/src/generic/paramlist.c
  
  Index: paramlist.c
  ===================================================================
  RCS file: /home/cvs/tcl-websh/src/generic/paramlist.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- paramlist.c	25 Oct 2001 17:50:13 -0000	1.3
  +++ paramlist.c	11 Feb 2002 12:46:32 -0000	1.4
  @@ -9,7 +9,7 @@
    * See the file "license.terms" for information on usage and
    * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    *
  - * @(#) $Id: paramlist.c,v 1.3 2001/10/25 17:50:13 davidw Exp $
  + * @(#) $Id: paramlist.c,v 1.4 2002/02/11 12:46:32 hefti Exp $
    *
    */
   
  @@ -352,10 +352,8 @@
   	     Tcl_Interp * interp,
   	     int objc, Tcl_Obj * CONST objv[], int hasPrivate)
   {
  -
  -
  -    char *arg;
  -    int opt;
  +    char *arg = NULL;
  +    int  opt = 0;
   
       /* --------------------------------------------------------------------------
        * sanity
  @@ -363,11 +361,6 @@
   
       WebAssertData(interp, paramList, "paramList/paramGet", TCL_ERROR);
   
  -    /* fixme: what for? */
  -    /* probably not necessary:
  -     * WebAssertArgs(interp,objc,objv,paramsubcmd,count,2);
  -     */
  -
       /* if there are no args -> continue with private parsing */
       if (objc < 2) {
   	if (hasPrivate)
  @@ -376,6 +369,7 @@
   	    WebAssertObjc(1, 1, "args ...");
   	}
       }
  +
       /* see if there is a subcommand */
       arg = Tcl_GetString(objv[1]);
       if (arg[0] == '-') {
  @@ -443,7 +437,7 @@
       }
       else {
   	/* no subcommand -> return value */
  -	WebAssertObjc(objc > 3, 2, "key ?default?");
  +	WebAssertObjc(objc > 3, 1, "key ?default?");
   	if (objc == 3)
   	    return paramListGetValueToResult(interp, paramList, objv[1],
   					     objv[2]);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-cvs-help@tcl.apache.org