Changeset 1c6c4d3 for commands.c


Ignore:
Timestamp:
Jun 30, 2002, 4:58:09 PM (18 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
507d5aa
Parents:
262422c
Message:
	Added owl_sprintf which returns the formatted string, or NULL.
	        The caller must free this string.
		This will allocate enough memory and thus
		avoid potential some buffer overrun situations.
	Started fixing some potential buffer overrun situations.
	Simple implementation of 'zwrite -m' (doesn't yet log an outgoing
	        message as having been sent.)
	The "Not logged in or subscribing to messages" error
	        now includes the name of the recipient.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rb68f9cd r1c6c4d3  
    8181  OWLCMD_ARGS("zwrite", owl_command_zwrite, OWL_CTX_INTERACTIVE,
    8282              "send a zephyr",
    83               "zwrite [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcde] [<user> ...] ",
     83              "zwrite [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcde] [<user> ...] [-m <message...>]",
    8484              "Zwrite send a zephyr to the one or more users specified.\n\n"
    8585              "The following options are available:\n\n"
     86              "-m    Specifies a message to send without prompting.\n"
     87              "      Note that this does not yet log an outgoing message.\n"
     88              "      This must be the last argument.\n\n"
    8689              "-n    Do not send a ping message.\n\n"
    8790              "-C    If the message is sent to more than one user include a\n"
     
    11111114
    11121115char *owl_command_zwrite(int argc, char **argv, char *buff) {
    1113   char *tmpbuff;
     1116  char *tmpbuff, *pos, *cmd, *msg;
     1117
     1118  /* check for a zwrite -m */
     1119  for (pos = buff; *pos; pos = skiptokens(pos, 1)) {
     1120    if (!strncmp(pos, "-m ", 3)) {
     1121      cmd = owl_strdup(buff);
     1122      msg = cmd+(pos-buff);
     1123      *msg = '\0';
     1124      msg += 3;
     1125      owl_zwrite_create_and_send_from_line(cmd, msg);
     1126      owl_free(cmd);
     1127      return NULL;
     1128    }
     1129  }
     1130
    11141131  if (argc < 2) {
    11151132    owl_function_makemsg("Not enough arguments to the zwrite command.");
Note: See TracChangeset for help on using the changeset viewer.