- while (argsp < (this_cmd + vec_len (this_cmd)))
- {
- if (*argsp == ' ' || *argsp == '\t' || *argsp == '\n')
- {
- argsp++;
- }
- else
- break;
- }
+ /* No arguments? Ensure that argsp points to a proper (empty) string */
+ if (argsp == (this_cmd + vec_len (this_cmd) - 1))
+ argsp[0] = 0;
+ else
+ while (argsp < (this_cmd + vec_len (this_cmd)))
+ {
+ if (*argsp == ' ' || *argsp == '\t' || *argsp == '\n')
+ {
+ argsp++;
+ }
+ else
+ break;
+ }