comparison src/ex_docmd.c @ 595:fea48f63efc8

updated for version 7.0169
author vimboss
date Tue, 13 Dec 2005 20:02:15 +0000
parents d133e7c550d0
children 05c67faedc8b
comparison
equal deleted inserted replaced
594:35cef95a6b76 595:fea48f63efc8
4547 else if (STRNCMP(arg, "encoding", 8) == 0) 4547 else if (STRNCMP(arg, "encoding", 8) == 0)
4548 { 4548 {
4549 arg += 8; 4549 arg += 8;
4550 pp = &eap->force_enc; 4550 pp = &eap->force_enc;
4551 } 4551 }
4552 else if (STRNCMP(arg, "bad", 3) == 0)
4553 {
4554 arg += 3;
4555 pp = &eap->bad_char;
4556 }
4552 #endif 4557 #endif
4553 4558
4554 if (pp == NULL || *arg != '=') 4559 if (pp == NULL || *arg != '=')
4555 return FAIL; 4560 return FAIL;
4556 4561
4566 #endif 4571 #endif
4567 if (check_ff_value(eap->cmd + eap->force_ff) == FAIL) 4572 if (check_ff_value(eap->cmd + eap->force_ff) == FAIL)
4568 return FAIL; 4573 return FAIL;
4569 #ifdef FEAT_MBYTE 4574 #ifdef FEAT_MBYTE
4570 } 4575 }
4571 else 4576 else if (pp == &eap->force_enc)
4572 { 4577 {
4573 /* Make 'fileencoding' lower case. */ 4578 /* Make 'fileencoding' lower case. */
4574 for (p = eap->cmd + eap->force_enc; *p != NUL; ++p) 4579 for (p = eap->cmd + eap->force_enc; *p != NUL; ++p)
4575 *p = TOLOWER_ASC(*p); 4580 *p = TOLOWER_ASC(*p);
4581 }
4582 else
4583 {
4584 /* Check ++bad= argument. Must be a single-byte character, "keep" or
4585 * "drop". */
4586 p = eap->cmd + eap->bad_char;
4587 if (STRICMP(p, "keep") == 0)
4588 eap->bad_char = BAD_KEEP;
4589 else if (STRICMP(p, "drop") == 0)
4590 eap->bad_char = BAD_DROP;
4591 else if (MB_BYTE2LEN(*p) == 1 && p[1] == NUL)
4592 eap->bad_char = *p;
4593 else
4594 return FAIL;
4576 } 4595 }
4577 #endif 4596 #endif
4578 4597
4579 return OK; 4598 return OK;
4580 } 4599 }