Skip to content
Snippets Groups Projects
Select Git revision
  • e979477005fb12bc70931266241347d78f659602
  • development default protected
  • temp
  • master protected
  • #36
  • #24
  • #39
  • #38
  • #37
  • #35
  • #34
  • #33
  • #32
  • #31
  • #21
  • #22
  • #20
  • #23
  • #19
  • #17
  • #16
21 results

NavigationBar.vue

Blame
  • utils.c 965 B
    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include "utils.h"
    #define MAX 250
    
    void mysh_parse_command(const char* command,
                            int *argc, char*** argv)
    {
      // TODO: Fill this!
    	
    	char *token=NULL;
    	char command1[MAX];
    	char *tmp = NULL;
    	strcpy(command1,command);
    	if(command1[strlen(command1)-1] == '\n')
    			command1[strlen(command1)-1] = '\0';
    	token = strtok(command1," =\n\"\0");
    //	**argv = (char*)malloc(sizeof(char)*MAX);
    	*argv = (char**)malloc(sizeof(char)*MAX);
    	*argc = 0;
    	while(1)
    	{
    		//printf("while\n");
    		if(token==NULL){
    				//*(*argv+(*argc)) = (char*)malloc(sizeof(char)*MAX);
    				
    				break;
    		}
    		else {
    			//printf("else\n");
    			*(*argv+(*argc)) = (char*)malloc(sizeof(char)*MAX);
    			//printf("malloc\n");
    			strcpy(*(*argv+(*argc)),token);
    			//printf("intoken\n");
    			token = strtok(NULL," =\n\0\"");
    			printf("%s\n",*(*argv+(*argc)));
    			(*argc)++;
    			//printf("%s\n",*(*argv+(*argc)));		
    		}
    	}
    
    
    
    }