Diff for /freem/src/global_bltin.c between versions 1.20 and 1.21

version 1.20, 2025/04/11 18:24:32 version 1.21, 2025/04/11 20:55:49
Line 24 Line 24
  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.   *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
  *   *
  *   $Log$   *   $Log$
    *   Revision 1.21  2025/04/11 20:55:49  snw
    *   Disable -Wunused-result where possible
    *
  *   Revision 1.20  2025/04/11 18:24:32  snw   *   Revision 1.20  2025/04/11 18:24:32  snw
  *   Fix bug in memory cache   *   Fix bug in memory cache
  *   *
Line 749  void global_bltin (short action, char *k Line 752  void global_bltin (short action, char *k
     register long int k;      register long int k;
     register long int ch;      register long int ch;
   
     j = 0;      j = 0;    
       
     hdr_offset = sizeof (global_header);      hdr_offset = sizeof (global_header);
           
     /* process optional limitations */      /* process optional limitations */
     if (glvnflag.all && key[0] >= '%' && key[0] <= 'z') {      if (glvnflag.all && key[0] >= '%' && key[0] <= 'z') {
   
         if ((i = glvnflag.one[0])) {    /* number of significant chars */          if ((i = glvnflag.one[0])) {    /* number of significant chars */
   
             j = 0;              j = 0;
             while ((k = key[j]) != DELIM && k != EOL) {              while ((k = key[j]) != DELIM && k != EOL) {
   
                 if (j >= i) {                  if (j >= i) {
                       
                     while ((k = key[++j]) != DELIM && k != EOL);                      while ((k = key[++j]) != DELIM && k != EOL);
   
                     stcpy (&key[i], &key[j]);                      stcpy (&key[i], &key[j]);
                       
                     break;                      break;
                 }                  }
   
                 j++;                  j++;
   
             }              }
         }          }
   
         if (glvnflag.one[1]) {          /* upper/lower sensitivity */          if (glvnflag.one[1]) {          /* upper/lower sensitivity */
               
             j = 0;              j = 0;
               
             while ((k = key[j]) != DELIM && k != EOL) {              while ((k = key[j]) != DELIM && k != EOL) {
               
                 if (k >= 'a' && k <= 'z') key[j] = k - 32;                  if (k >= 'a' && k <= 'z') key[j] = k - 32;
               
                 j++;                  j++;
               
             }              }
   
         }          }
   
         if ((i = glvnflag.one[2])) {          if ((i = glvnflag.one[2])) {
   
             if (stlen (key) > i) {              if (stlen (key) > i) {
                 merr_raise (M75);                  merr_raise (M75);
                 return;                  return;
             }                           /* key length limit */              }                           /* key length limit */
   
         }          }
   
         if ((i = glvnflag.one[3])) {    /* subscript length limit */          if ((i = glvnflag.one[3])) {    /* subscript length limit */
               
             j = 0;              j = 0;
               
             while ((k = key[j++]) != DELIM && k != EOL);              while ((k = key[j++]) != DELIM && k != EOL);
               
             if (k == DELIM) {              if (k == DELIM) {
               
                 k = 0;                  k = 0;
                 for (;;) {                  for (;;) {
               
                     k = key[j++];                      k = key[j++];
               
                     if (k == DELIM || k == EOL) {                      if (k == DELIM || k == EOL) {
               
                         if (k > i) {                          if (k > i) {
                             merr_raise (M75);                              merr_raise (M75);
                             return;                              return;
                         }                          }
               
                         k = 0;                          k = 0;
                     }                      }
   
                     if (k == EOL) break;                      if (k == EOL) break;
                           
                     k++;                      k++;
                 }                  }
             }              }
               
         }          }
     }      }
   
Line 888  void global_bltin (short action, char *k Line 870  void global_bltin (short action, char *k
         }          }
     }      }
   
     if (v22ptr) {  
   
         procv22 (key);  
           
         if (key[0] != '^') {  
             char    losav[256];  
   
             stcpy (losav, l_o_val);  
             symtab (action, key, data);  
             stcpy (g_o_val, l_o_val);  
             stcpy (l_o_val, losav);  
   
             return;  
         }  
     }  
   
     g = gbl_handle (key);          g = gbl_handle (key);    
     i = gbl_path (key, filnam);      i = gbl_path (key, filnam);
                   
Line 968  void global_bltin (short action, char *k Line 934  void global_bltin (short action, char *k
                 compactkey[k++] = ch << 1;                  compactkey[k++] = ch << 1;
   
             }               } 
             else if (ch < SP || ch >= DEL) {              else if (ch < SP || ch >= DEL) {                
                                   /* no CTRLs */
                 /*no CTRLs */  
   
                 merr_raise (SBSCR);                                  merr_raise (SBSCR);                
                 return;                  return;
             }              }

Removed from v.1.20  
changed lines
  Added in v.1.21


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>