home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / softsys / khoros / 2951 < prev    next >
Encoding:
Internet Message Format  |  1992-11-21  |  5.0 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!mimbres.cs.unm.edu!pprg.unm.edu!daemon
  2. From: young@chama.eece.unm.edu (Mark Young)
  3. Newsgroups: comp.soft-sys.khoros
  4. Subject: cantata expression bug (fix) on Omron/NeXT(MACH)...
  5. Message-ID: <41777@pprg.eece.unm.edu.pprg.unm.edu>
  6. Date: 21 Nov 92 18:04:38 GMT
  7. Article-I.D.: pprg.41777
  8. Sender: daemon@pprg.unm.edu
  9. Lines: 112
  10.  
  11.  
  12. Hi,
  13.  
  14.   This next bug is also complements of Jon Hale of Omron Corporation.
  15. The bug is that cantata's expression parser does not work on certain
  16. machines.  It gives bogus results and thus executes processes with
  17. incorrect command line arguments.  The problem will show up on Omron
  18. and NeXT machines, but probably all machines running mach.  It has to
  19. do with mach's interpetation of scanf().  In traditional UNIX scanf()
  20. routines, when the first token of the input command is not matched the
  21. operation is aborted, but in mach the scanf() routine continues match-
  22. ing it's arguments.  Therefore when we were checking the text line with
  23. the string scan routine for the input i*25:
  24.  
  25.      sscanf(string,"%f%s",&floatval,leftover)
  26.  
  27. mach's sscanf() will return 1 matched token, storing "i*25" in the
  28. leftover string array, thus skipping the initial "%f" input command
  29. token.  Following is th fix that should be applied at the toplevel
  30. of $KHOROS_HOME using patch -c < patchfile.  Then the xvforms library
  31. and cantata will need to be recompiled and installed.
  32.  
  33.             Mark
  34.  
  35. -----------------------------------------------------------------------------
  36. Mark Young                         young@chama.eece.unm.edu
  37.  
  38. Khoros Group                       (505) 277-6563  (work)
  39. University of New Mexico           Albuquerque,    NM 87131
  40. -----------------------------------------------------------------------------
  41. Humor is something that is plentyful if you are willing to laugh at yourself.
  42.  
  43. *** src/xvroutines/Lib/xvforms/form_util.c    Wed Jul 22 13:33:13 1992
  44. --- src/xvroutines/Lib/xvforms/form_util.c    Wed Nov 18 09:48:23 1992
  45. ***************
  46. *** 960,966 ****
  47.           xvf_parse_int_line(db[sel->index],&line_info);
  48.           if ((line_info.optional == true) && (line_info.opt_sel == false))
  49.              break;
  50. !         if (sscanf(line_info.literal,"%d%s", &ivalue, leftover) != 1)
  51.           {
  52.              if (!(xve_eval_int(id, line_info.literal, &ivalue, error)))
  53.                  {
  54. --- 951,959 ----
  55.           xvf_parse_int_line(db[sel->index],&line_info);
  56.           if ((line_info.optional == true) && (line_info.opt_sel == false))
  57.              break;
  58. !         leftover[0] = '\0';
  59. !         if (sscanf(line_info.literal,"%d%s", &ivalue, leftover) != 1 ||
  60. !         leftover[0] != '\0')
  61.           {
  62.              if (!(xve_eval_int(id, line_info.literal, &ivalue, error)))
  63.                  {
  64. ***************
  65. *** 985,991 ****
  66.           xvf_parse_float_line(db[sel->index],&line_info);
  67.           if ((line_info.optional == true) && (line_info.opt_sel == false))
  68.              break;
  69. !         if (sscanf(line_info.literal,"%f%s", &fvalue, leftover) != 1)
  70.           {
  71.              if (!(xve_eval_float(id, line_info.literal, &fvalue, error)))
  72.                  {
  73. --- 978,986 ----
  74.           xvf_parse_float_line(db[sel->index],&line_info);
  75.           if ((line_info.optional == true) && (line_info.opt_sel == false))
  76.              break;
  77. !         leftover[0] = '\0';
  78. !         if (sscanf(line_info.literal,"%f%s", &fvalue, leftover) != 1 ||
  79. !             leftover[0] != '\0')
  80.           {
  81.              if (!(xve_eval_float(id, line_info.literal, &fvalue, error)))
  82.                  {
  83. *** src/xvroutines/Lib/xvforms/collect.c    Wed Mar 11 20:07:00 1992
  84. --- src/xvroutines/Lib/xvforms/collect.c    Wed Nov 18 09:47:59 1992
  85. ***************
  86. *** 197,203 ****
  87.       xvf_parse_int_line(database[current->index], &line_info);
  88.   
  89.       /* see if it's not a regular integer (ie, an expression) */
  90. !     if (sscanf(current->buffer,"%d%s",&tmp_int,leftover) != 1)
  91.       {
  92.           /* can't scan it normally - try to evaluate expression */
  93.           id = (long) formptr; /* this is the id for this form */
  94. --- 197,205 ----
  95.       xvf_parse_int_line(database[current->index], &line_info);
  96.   
  97.       /* see if it's not a regular integer (ie, an expression) */
  98. !     leftover[0] = '\0';
  99. !     if (sscanf(current->buffer,"%d%s",&tmp_int,leftover) != 1 ||
  100. !         leftover[0] != '\0')
  101.       {
  102.           /* can't scan it normally - try to evaluate expression */
  103.           id = (long) formptr; /* this is the id for this form */
  104. ***************
  105. *** 340,346 ****
  106.       xvf_parse_float_line(database[current->index], &line_info);
  107.   
  108.       /* see if it's not a regular float (ie, could be an expression) */
  109. !     if (sscanf(current->buffer,"%f%s",&tmp_float,leftover) != 1)
  110.       {
  111.           /* can't scan it normally - try to evaluate expression */
  112.           id = (long) formptr; /* this is the id for this form */
  113. --- 342,350 ----
  114.       xvf_parse_float_line(database[current->index], &line_info);
  115.   
  116.       /* see if it's not a regular float (ie, could be an expression) */
  117. !     leftover[0] = '\0';
  118. !     if (sscanf(current->buffer,"%f%s",&tmp_float,leftover) != 1 ||
  119. !         leftover[0] != '\0')
  120.       {
  121.           /* can't scan it normally - try to evaluate expression */
  122.           id = (long) formptr; /* this is the id for this form */
  123.