commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-commons-sandbox/daemon/src/native/nt/procrun procgui.c
Date Mon, 28 Apr 2003 12:56:44 GMT
mturk       2003/04/28 05:56:44

  Modified:    daemon/src/native/nt/procrun procgui.c
  Log:
  Fix the setting for Java VM options.
  This is multiline string, so needs conversion \r\n -> #.
  
  Revision  Changes    Path
  1.10      +20 -5     jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c
  
  Index: procgui.c
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- procgui.c	28 Apr 2003 11:49:25 -0000	1.9
  +++ procgui.c	28 Apr 2003 12:56:43 -0000	1.10
  @@ -574,6 +574,7 @@
       char *argv[10];
       char txt[4096];
       process_t p;
  +    char *s, *d;
   
       switch (uMessage) {
           case WM_COMMAND:
  @@ -591,7 +592,17 @@
               SetDlgItemText(hdlg, RC_TXT_EC, txt);
               if (!strcmp(g_env->m->java.display, "auto"))
                   CheckDlgButton(hdlg, RC_CHK_JVM, BST_CHECKED);
  -
  +            
  +            strcpy(txt, g_env->m->java.opts);
  +            memset(txt, 0, 4096);
  +            d = &txt[0];
  +            for (s = g_env->m->java.opts; s && *s; s++) {
  +                sprintf(d, "%s\r\n", s);
  +                d += strlen(d);
  +                while (*s)
  +                    s++;
  +            }
  +            SetDlgItemText(hdlg, RC_TXT_JO, txt);
           break;
           case WM_NOTIFY:
               lpnmhdr = (NMHDR FAR *)lParam;
  @@ -618,19 +629,23 @@
                   }
                   if (GetDlgItemText(hdlg, RC_TXT_EC, txt, 4095) > 0) {
                       argc = 2;
  -                    argv[argc++] = "--" PROCRUN_PARAMS_STARTCLASS;
  +                    argv[argc++] = "--" PROCRUN_PARAMS_STOPCLASS;
                       argv[argc++] = &txt[0];
                       procrun_update_service(&p, argc, argv);
                   }
                   if (GetDlgItemText(hdlg, RC_TXT_JO, txt, 4095) > 0) {
                       char *c = &txt[0];
  +                    char b[4096];
  +                    int i = 0;
                       argc = 2;
                       while (*c) {
  -                        if (*c == '\n') *c = '#';
  -                        ++c;
  +                        if (*c == '\n')
  +                            b[i++] = '#';
  +                        else if (*c != '\r')
  +                            b[i++] = *c;
                       }
                       argv[argc++] = "--" PROCRUN_PARAMS_JVM_OPTS;
  -                    argv[argc++] = &txt[0];
  +                    argv[argc++] = &b[0];
                       procrun_update_service(&p, argc, argv);
                   }
                   break;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message