Changes in / [a962f5c:7803326]


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r2dd9c48 r7803326  
    19851985  }
    19861986  /* check for a zwrite -m */
    1987   z = owl_zwrite_new(argc, argv);
     1987  z = owl_zwrite_new(buff);
    19881988  if (!z) {
    19891989    owl_function_error("Error in zwrite arguments");
  • util.c

    r7b89e8c r6646fdb  
    262262CALLER_OWN char *owl_arg_quote(const char *arg)
    263263{
    264   GString *buf = g_string_new("");
     264  GString *buf = g_string_new("");;
    265265  owl_string_append_quoted_arg(buf, arg);
    266   return g_string_free(buf, false);
    267 }
    268 
    269 /* Returns a quoted version of argv. owl_parseline on the result should give
    270  * back the input. */
    271 CALLER_OWN char *owl_argv_quote(int argc, const char *const *argv)
    272 {
    273   int i;
    274   GString *buf = g_string_new("");
    275   for (i = 0; i < argc; i++) {
    276     if (i > 0)
    277       g_string_append_c(buf, ' ');
    278     owl_string_append_quoted_arg(buf, argv[i]);
    279   }
    280266  return g_string_free(buf, false);
    281267}
  • zephyr.c

    rd953ede rf271129  
    909909  g_free(to);
    910910
    911   z = owl_zwrite_new_from_line(tmpbuff);
     911  z = owl_zwrite_new(tmpbuff);
    912912  g_free(tmpbuff);
    913913  if (z == NULL) {
  • zwrite.c

    rd6c2e03 rf271129  
    11#include "owl.h"
    22
    3 CALLER_OWN owl_zwrite *owl_zwrite_new_from_line(const char *line)
     3CALLER_OWN owl_zwrite *owl_zwrite_new(const char *line)
    44{
    55  owl_zwrite *z = g_new(owl_zwrite, 1);
     
    1111}
    1212
    13 CALLER_OWN owl_zwrite *owl_zwrite_new(int argc, const char *const *argv)
    14 {
    15   owl_zwrite *z = g_new(owl_zwrite, 1);
    16   if (owl_zwrite_create(z, argc, argv) < 0) {
    17     owl_zwrite_delete(z);
    18     return NULL;
    19   }
    20   return z;
    21 }
    22 
    2313G_GNUC_WARN_UNUSED_RESULT int owl_zwrite_create_from_line(owl_zwrite *z, const char *line)
    2414{
    25   int argc;
     15  int argc, badargs, myargc;
    2616  char **argv;
    27   int ret;
    28 
    29   /* parse the command line for options */
    30   argv = owl_parseline(line, &argc);
    31   if (argc < 0) {
    32     owl_function_error("Unbalanced quotes in zwrite");
    33     return -1;
    34   }
    35   ret = owl_zwrite_create(z, argc, strs(argv));
    36   g_strfreev(argv);
    37   return ret;
    38 }
    39 
    40 G_GNUC_WARN_UNUSED_RESULT int owl_zwrite_create(owl_zwrite *z, int argc, const char *const *argv)
    41 {
    42   int badargs, myargc;
    4317  const char *const *myargv;
    4418  char *msg = NULL;
     
    5731  z->noping=0;
    5832  z->recips = g_ptr_array_new();
    59   z->zwriteline = owl_argv_quote(argc, argv);
    60 
    61   myargc = argc;
    62   myargv = argv;
     33  z->zwriteline = g_strdup(line);
     34
     35  /* parse the command line for options */
     36  argv=owl_parseline(line, &argc);
     37  myargv=strs(argv);
     38  if (argc<0) {
     39    owl_function_error("Unbalanced quotes in zwrite");
     40    return(-1);
     41  }
     42  myargc=argc;
    6343  if (myargc && *(myargv[0])!='-') {
    6444    z->cmd=g_strdup(myargv[0]);
     
    139119  }
    140120
     121  g_strfreev(argv);
     122
    141123  if (badargs) {
    142124    return(-1);
Note: See TracChangeset for help on using the changeset viewer.